When I run a particular application I've been working on for a while, it
somehow finds a value for the Application Setting
"Test.Properties.Settings.Default.ProjectPath" , but I can't see where it is
acquiring the value! I have been through all of the project's Properties,
and read through every app.config on my entire computer and can't find the
value it's getting during runtime.
Mysteriously, when I step through the application in debug mode, that
Application Setting never does acquire a value. Only when I run the
(debug-compiled) executable outside of the debugger does it find an old value.
Any ideas on how this can happen, and how I can find an purge the rogue
value from my computer? 9 2542
Dave Booker wrote: When I run a particular application I've been working on for a while, it somehow finds a value for the Application Setting "Test.Properties.Settings.Default.ProjectPath" , but I can't see where it is acquiring the value! I have been through all of the project's Properties, and read through every app.config on my entire computer and can't find the value it's getting during runtime.
Mysteriously, when I step through the application in debug mode, that Application Setting never does acquire a value. Only when I run the (debug-compiled) executable outside of the debugger does it find an old value.
Any ideas on how this can happen, and how I can find an purge the rogue value from my computer?
I presume you're using VS2005? In that case, in the solution explorer,
expand the node of your project that says "Properties", then expand
"Settings.settings". Under that open the Settings.Designer.cs. You
should see your properties similar to this:
[global::System.Configuration.ApplicationScopedSett ingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttr ibute()]
[global::System.Configuration.DefaultSettingValueAt tribute("DefaultValue")]
public string SqlInstance {
get {
return ((string)(this["SqlInstance"]));
}
}
The default value is in the DefaultSettingValueAttribute.
Hope this helps
Yes, this is a VS2005 project and application. The
DefaultSettingValueAttribute in the Settings is "", so it's not picking up
the value there. I.e.,
[global::System.Configuration.DefaultSettingValueAt tribute("")]
public string ProjectPath {
"Chris Dunaway" wrote: I presume you're using VS2005? In that case, in the solution explorer, expand the node of your project that says "Properties", then expand "Settings.settings". Under that open the Settings.Designer.cs. You should see your properties similar to this:
[global::System.Configuration.ApplicationScopedSett ingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttr ibute()]
[global::System.Configuration.DefaultSettingValueAt tribute("DefaultValue")] public string SqlInstance { get { return ((string)(this["SqlInstance"])); } }
The default value is in the DefaultSettingValueAttribute.
Hope this helps
Hi Dave,
Thank you for posting.
Is the ProjectPath a user-scoped setting in your project?
The default value of a user-scoped setting is stored in the application
config file which is located in the same path of the exe file. However, if
you have changed the value of the user-scoped setting at run-time and saved
the new value back to the disk, the new value is stored in a user config
file named user.config. The user config file is located in the local
settings path of the current user. For example, the path may look like this:
"C:\Documents and Settings\Administrator\Local Settings\Application
Data\MS\MyTestProjectName \1.0.0.0".
Once there's a value in the user config file, this value is retrieved as
the user-scoped setting's value.
Please check the user config file of your application on your machine. I
think you may find the value of the ProjectPath setting there.
I look forward to your reply.
Sincerely,
Linda Liu
Microsoft Online Community Support
================================================== ==
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ==
Sounds promising -- the Settings.settings in the project do mark all of the
setting names as Scope "User".
But there is not a single user.config file under my entire "C:\Documents and
Settings" directory hierarchy (according to Windows Search). And in any case
I could not find a folder under there that resembles my project/application
name.
Is there someplace else the user settings could be hiding?
"Linda Liu [MSFT]" wrote: Hi Dave,
Thank you for posting.
Is the ProjectPath a user-scoped setting in your project?
The default value of a user-scoped setting is stored in the application config file which is located in the same path of the exe file. However, if you have changed the value of the user-scoped setting at run-time and saved the new value back to the disk, the new value is stored in a user config file named user.config. The user config file is located in the local settings path of the current user. For example, the path may look like this: "C:\Documents and Settings\Administrator\Local Settings\Application Data\MS\MyTestProjectName \1.0.0.0".
Once there's a value in the user config file, this value is retrieved as the user-scoped setting's value.
Please check the user config file of your application on your machine. I think you may find the value of the ProjectPath setting there.
I look forward to your reply.
Sincerely, Linda Liu Microsoft Online Community Support
Hi Dave,
Thanks for your update and response.
A user.config file is created at run time when the user running the
application changes the value of any user setting. If you never change the
value of any user setting, there won't be a user.config file.
The default values of all the application settings of a program are stored
in the app.config file which is located under the directory of the project.
And this app.config file will be exported to an exe.config file in the
project's output path. If the name of your project is SampleProj, the name
of the config file is SampleProj.exe.config.
I recommend you to check this app.config file or exe.config file in your
project.
If you have anything unclear, please don't hesitate to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
================================================== ==
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== ==
OK, I thought your answers would cover anything, but I still cannot find some
settings.
To summarize your earlier answers, an application setting must appear in one
of the following places:
1. app.config, in the root of the project directory.
2. user.config, somewhere in the Documents and Settings folders
3. {App}.exe.config, where {App}.exe is the compiled application
I have searched every file meeting the above criteria and still cannot find
the value being assigned to one of the application settings in my program!
Would appreciate any other hints as to where or how I might find that!
"Linda Liu [MSFT]" wrote: Hi Dave,
Thanks for your update and response.
A user.config file is created at run time when the user running the application changes the value of any user setting. If you never change the value of any user setting, there won't be a user.config file.
The default values of all the application settings of a program are stored in the app.config file which is located under the directory of the project. And this app.config file will be exported to an exe.config file in the project's output path. If the name of your project is SampleProj, the name of the config file is SampleProj.exe.config.
I recommend you to check this app.config file or exe.config file in your project.
If you have anything unclear, please don't hesitate to let me know.
Sincerely, Linda Liu Microsoft Online Community Support
================================================== == When responding to posts,please "Reply to Group" via your newsreader so that others may learn and benefit from your issue. ================================================== ==
Problem solved. Turns out the settings I was looking for WERE under the
Documents and Settings hierarchy; not sure why the Windows Search command
couldn't find them. For the benefit of posterity, the way I finally fixed
this: Open the project's Properties/Settings.settings in Visual Studio, then
click on the Synchronize button in the top left of that tab.
Doing so gave me a warning that referenced the exact location of the rogue
file that had been storing the values the application had been using, and
also gave me the benefit of clearing those accumulated settings!
"Dave Booker" wrote: OK, I thought your answers would cover anything, but I still cannot find some settings.
To summarize your earlier answers, an application setting must appear in one of the following places:
1. app.config, in the root of the project directory. 2. user.config, somewhere in the Documents and Settings folders 3. {App}.exe.config, where {App}.exe is the compiled application
I have searched every file meeting the above criteria and still cannot find the value being assigned to one of the application settings in my program!
Would appreciate any other hints as to where or how I might find that!
Could be that the rouge file was in a hidden directory. I don't think
the windows search will go into hidden directories by default, you have
to tell it to do so under advanced options (I also turn on system
folders when searching for specific files to make sure I get
everything).
On Tue, 27 Jun 2006 14:39:01 -0700, Dave Booker
<db******@newsgroup.nospam> wrote: Problem solved. Turns out the settings I was looking for WERE under the Documents and Settings hierarchy; not sure why the Windows Search command couldn't find them. For the benefit of posterity, the way I finally fixed this: Open the project's Properties/Settings.settings in Visual Studio, then click on the Synchronize button in the top left of that tab.
Doing so gave me a warning that referenced the exact location of the rogue file that had been storing the values the application had been using, and also gave me the benefit of clearing those accumulated settings!
"Dave Booker" wrote:
OK, I thought your answers would cover anything, but I still cannot find some settings.
To summarize your earlier answers, an application setting must appear in one of the following places:
1. app.config, in the root of the project directory. 2. user.config, somewhere in the Documents and Settings folders 3. {App}.exe.config, where {App}.exe is the compiled application
I have searched every file meeting the above criteria and still cannot find the value being assigned to one of the application settings in my program!
Would appreciate any other hints as to where or how I might find that!
Hi Dave,
Thank you for your update.
It seems that there're several possible places for .NET to store the
user.config file under the Documents and Settings hierarchy. Your method to
find out the location of the user.config file is very useful.
If you have any other questions, please don't hesitate to contact us.
Have a nice day!
Sincerely,
Linda Liu
Microsoft Online Community Support
================================================== ==
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
================================================== == This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Google Mike |
last post by:
I need an Application object replacement. I was creating my own using
shared memory -- shm* API in PHP. I was doing fine for 6 months until
it just got too fat, I guess, and the RH9 Linux server...
|
by: M Wells |
last post by:
Hi All,
Further to my previous long-winded question about a situation in which
we appear to be mysteriously losing data from our mssql2k server.
We discovered an update statement, in the...
|
by: Tony Houghton |
last post by:
I'm using pygame to write a game called Bombz which needs to save some
data in a directory associated with it. In Unix/Linux I'd probably use
"~/.bombz", in Windows something like
"C:\Documents...
|
by: Jon Slaughter |
last post by:
I wrote an app that needed to save settings such as colors, fonts, etc...
after hours of trying to use ConfigurationManager and AppSettings along with
a few other things I finally found that I...
|
by: xycos |
last post by:
Hello. I apologize for asking this question as the information I need is
availible via the MSDN library, however I cannot seemt o understand what I
need to do, so I'm asking here.
I have created...
|
by: steve |
last post by:
I am using vb.net 2005 Express Edition.
Application Settings would be a very useful thing, as a global program database
that persists; if only it would work! Does anyone know a hack or a...
|
by: Didje |
last post by:
Hi,
I'm trying to design a kind of calculator GUI using gridbaglayout.
At the top of the calculator will be a couple of menus and then will come the section with all the buttons etc.
Initially, I...
|
by: Logan1337 |
last post by:
I am getting the following exception:
Type 'Ross.ListViewer' in Assembly 'FeedBeast, Version=1.0.1.0, Culture=neutral, PublicKeyToken=d816ce10916cb185' is not marked as serializable.
...when I...
|
by: Astley Le Jasper |
last post by:
Sorry for the numpty question ...
How do you find the reference name of an object?
So if i have this
bob = modulename.objectname()
how do i find that the name is 'bob'
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
| |