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_0myugwc0sn 0h1p1cupnb2ay0ywdyyuft\1.0.0.0\user.config'.
(C:\Documents and Settings\<MY USERNAME>\Application
Data\...\tstScreenSaver1.vshost.ex_Url_0myugwc0sn0 h1p1cupnb2ay0ywdyyuft\1.0.0.0\user.config)"}
And if I check the system.Windows.Forms.Application.LocalUserAppDataP ath
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_ob2l hjb3pwszm3exvs3r2msjtgij5kcb\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.LocalUserAppDataP ath " 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