473,487 Members | 2,483 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Simple question on Properties.Settings

Dom
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?

Aug 24 '07 #1
7 18187
Dom wrote:
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
Aug 24 '07 #2
I think your question would be better suited to a different group,
try:

http://groups.google.com/group/DotNetDevelopment?hl=en
Aug 24 '07 #3
Dom
On Aug 24, 4:44 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
Dom wrote:
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
That did it. Thanks. Any idea why the immediate window is using the
wrong ns?

Aug 24 '07 #4
Dom
On Aug 24, 4:44 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
Dom wrote:
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
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

Aug 24 '07 #5
Hi,

"Dom" <do********@gmail.comwrote in message
news:11**********************@q5g2000prf.googlegro ups.com...
On Aug 24, 4:44 pm, Peter Duniho <NpOeStPe...@NnOwSlPiAnMk.comwrote:
>Dom wrote:
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

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?
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.
Aug 24 '07 #6
rhaazy wrote:
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?
Aug 24 '07 #7
Dom wrote:
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
Aug 24 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1464
by: Andrew Jocelyn | last post by:
Hi I have a simple ASP.NET web page with a single label control: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="default.aspx.vb" Inherits="proj.TheTime" EnableViewState="false"...
1
1383
by: Geoff Pennington | last post by:
I've never done any graphics before and am experimenting. I tried to draw a circle using the graphics.DrawEllipse() method, something like this: DrawEllipse(myPen, 0,0,300,300). However, the...
4
8709
by: eugenet | last post by:
Hello, I am writing a Windows Forms application using .NET Framework 2.0 and Visual Studio 2005. I would like to use Properties.Settings class to persist a collection of custom objects. For...
1
10225
by: randy1200 | last post by:
I have a DLL Winform project. I've double-clicked Settings.settings under Properties, and create the following application setting: Name: MySetting1, Type: string, Scope: Application, Value:...
4
1728
by: Shak | last post by:
Hi My code looks like the follwing: namespace A.B.C { .... private void foo() { A.B.C.Properties.Settings.Default.Save();
3
2316
by: Steve Long | last post by:
Hello. Can anyone tell me the proper way to save the properties of a user control between design time and run time? So, I've got this user control with the following properties: BarColor1...
13
7107
by: Dave | last post by:
When using the properties designer to store application wide properties how do you get this to work across a project group containing an EXE and a collection of DLLs. I'm using C#.Net 2005. I...
2
3603
by: Jan Eliasen | last post by:
Hi I am having some problems reading configuration values from a configuration file, using C# 2.0. I have programmed a Windows Service, and this part goes well - it runs nicely. Now, the...
3
1373
by: Morten Snedker | last post by:
How do I share a property across classes? For example I'll have three classes: - Settings - Class1 - Class2 Class1 will initiate the class Settings with a New Settings and will...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7181
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.