Vs2005 Application settings

C

Cristian

Hi I have some trouble (on only one developer computer) with the application
settings functions...

I have posted to the Microsoft.Public.vstudio.setup group but they couldn't
help me and asked me to post in this forum.

I paste both the messages I posted there..
---
Hi I have just installed VS2005 and the first thing I did was to try out the
new Screensaver sample. that wouldn't work it just crashed all the time.
After a little monking around i found out that it was the application
settings that just didn't work. It trowed an exception:
System.InvalidOperationException
with an innerexception of "{"Configuration system failed to initialize"}"
(with:) {"An error occurred loading a configuration file: Could not find a
part of the path 'C:\Documents and Settings\<MY
USERNAME>\tstScreenSaver1.vshost.ex_Url_0myugwc0sn0h1p1cupnb2ay0ywdyyuft\1.0.0.0\user.config'.
(C:\Documents and Settings\<MY USERNAME>\Application
Data\...\tstScreenSaver1.vshost.ex_Url_0myugwc0sn0h1p1cupnb2ay0ywdyyuft\1.0.0.0\user.config)"}
And if I check the system.Windows.Forms.Application.LocalUserAppDataPath
I see that it points to :C:\Documents and Settings\<MY USERNAME>\Local
Settings\Application Data\...\tstScreenSaver1\1.0.0.0

I don't know where the ... come from I guess it's why it wasn't able to find
the folder?

I can recreate this if I create another project and add a Application
setting

I even tried a repair on the visual studio installation but with no change.

Anyone got a good suggestion?
---
Rhett Gong[MSFT] answered that he didn't have a qlue and asked me for some
more info and detailed test.
I answered
---

* Create a new project (windows) (I'm using vb) ( My project is named
tst_SettingsEx)
* Right click on the Icon for the project and select properties
* go to "tab" settings
* add a new setting (I'm adding "Setting") with type "String" and Scope
"User" Value "test"
* Go back to form add a button (Button1) go to click event in codebehind
* add code
MsgBox(My.Settings.Setting)
* start project with debugging
* press the button
Result: look in attached file "Exception1" (a ConfigurationErrorsException
with the innerexception:
"An error occurred loading a configuration file: Could not find a part of
the path 'C:\Documents and
Settings\<USER>\tst_SettingsEx.vshost.exe_Url_ob2lhjb3pwszm3exvs3r2msjtgij5kcb\1.0.0.0\user.config'."
* additional when it has crashed (or if it won't put in a break or someother
mean to see this) in the debug window write "?
system.Windows.Forms.Application.LocalUserAppDataPath " my result is
"C:\Documents and Settings\<USER>\Local Settings\Application
Data\...\tst_SettingsEx\1.0.0.0"

I'm guessing that it has something to do with the path.. I guess that the
result shouldn't contain ... in it. it should be something else. That's why
I think it's related to the installation of Visual studio. Like I stated in
the last post I have tried to repair the installation with no luck.

---
So I hope that you could help me better. After this I have tried to recreate
this on some other computer but havn't suceeded. I guess that it's some
setting or file that is corrupt but a repair didn't help so...

Thanks for your help..

// Cristian
 
P

Peter Huang [MSFT]

Hi

As you said, I also wonder it seems that the VS.NET 2005 is not correctly
installed, because the simplest test with Appsetting failed too.
So far another possible is if the user has the full privileges.
So you may try to run the test again under the administrator account.

Also you may to try to use filemon to see when you create the user scope
setting and save, if there is any file created/read/write under the dir
below.
C:\Documents and Settings\<MY USERNAME>\Application Data\....\user.config

After that when you try to read the appsettting when the problem running,
did the file is loaded? or is it trying to find another file?

You may perform the test and let me know the result.

Also I think a throughly reinstall may be usefully in this scenario.

BTW: filemon can be found in the webpath below.
http://www.sysinternals.com/Utilities/Filemon.html


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top