Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2007

Tip: Looking for answers? Try searching our database.

Simple question on Properties.Settings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dom - 24 Aug 2007 21:30 GMT
It seems I can't look at the Properties.Settings.Default.xxxx value in
the immediate window while I'm in debug mode.  If I try, I get the
message:  "'System.Windows.Forms.PropertyStore' does not contain a
definition for 'Settings'"

I can still Debug.Print the value in my code.

What gives?
Peter Duniho - 24 Aug 2007 21:44 GMT
> It seems I can't look at the Properties.Settings.Default.xxxx value in
> the immediate window while I'm in debug mode.  If I try, I get the
> message:  "'System.Windows.Forms.PropertyStore' does not contain a
> definition for 'Settings'"

Sounds like a namespace issue.  The actual application
Properties.Settings.Default.xxxx values are not in
System.Windows.Forms.PropertyStore, so you can see from the error that
the immediate window is trying to use a different Properties than the
one you need.

The Settings class in which the values exist is actually in Properties
namespace within your own application's namespace.

So, if your program's namespace is MyProgram, you should be able to show
the settings via MyProgram.Properties.Settings.Default.xxxx (where xxxx
is whatever setting you're looking for, of course).

Pete
Dom - 24 Aug 2007 21:49 GMT
> > It seems I can't look at the Properties.Settings.Default.xxxx value in
> > the immediate window while I'm in debug mode.  If I try, I get the
[quoted text clipped - 15 lines]
>
> Pete

That did it.  Thanks.  Any idea why the immediate window is using the
wrong ns?
Peter Duniho - 24 Aug 2007 22:57 GMT
> That did it.  Thanks.  Any idea why the immediate window is using the
> wrong ns?

Nope.  Sorry.  I will agree with Ignacio that I doubt this is a
consequence of your moving things into a separate folder, though I can't
rule it out.  Doing that does, as you noticed, change the default
namespace for new things, but I don't see why it'd affect how the
immediate window chooses namespaces.

I have precious little experience using the immediate window though, so
I don't have anything useful to offer with respect to why it does what
it does.  Sorry.

Pete
Dom - 24 Aug 2007 21:56 GMT
> > It seems I can't look at the Properties.Settings.Default.xxxx value in
> > the immediate window while I'm in debug mode.  If I try, I get the
[quoted text clipped - 15 lines]
>
> Pete

I wander if I screwed things up here.  I have several classes that
serve a similar purpose.  All of them are in the name space,
"MyProgram".  Then later, just to fool around with the IDE, I decided
to create a folder, "Items", in the Solution Explorer, and move all
the classes to that folder, since they do similar work.  If I create a
new class within the folder, the namespace comes up as
"MyProgram.Items".  The other classes, of course, do not have this NS.

Is that a bad policy?

Dom
Ignacio Machin ( .NET/ C# MVP ) - 24 Aug 2007 22:06 GMT
Hi,

>> > It seems I can't look at the Properties.Settings.Default.xxxx value in
>> > the immediate window while I'm in debug mode.  If I try, I get the
[quoted text clipped - 25 lines]
>
> Is that a bad policy?

Moving classes to folders?
Of course no.
The IDE by default create a new sub namespace per each folder that you add,
sometimes you want it, sometimes you don't. You can simply edit the source
code and remove the sub namespace. I do not recall if this is a config
option  in the IDE though.
rhaazy - 24 Aug 2007 21:46 GMT
I think your question would be better suited to a different group,
try:

http://groups.google.com/group/DotNetDevelopment?hl=en
Peter Duniho - 24 Aug 2007 22:55 GMT
> I think your question would be better suited to a different group,
> try: [snip]

In what way is that non-Microsoft-supported, non-Usenet, web-only forum
better than this newsgroup?

And if it is, shouldn't you just post a similar reply to every single
post in this newsgroup?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.