tag:blogger.com,1999:blog-28314047.post115533054158462436..comments2023-06-15T06:12:57.799-07:00Comments on Dot Net Project: How can I get the user.config file path programmatically in a non-Clickonce app?Tarashttp://www.blogger.com/profile/08190352805764968698noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-28314047.post-12493073070511606142009-12-30T01:31:20.289-08:002009-12-30T01:31:20.289-08:00Another way for getting path to user configuration...Another way for getting path to user configuration file:<br /><br />string path = Application.LocalUserAppDataPath<br /><br />OR<br /><br />strign path = System.Windows.Forms.Application.LocalUserAppDataPathUnknownhttps://www.blogger.com/profile/07506462926281126108noreply@blogger.comtag:blogger.com,1999:blog-28314047.post-35690042152171268702008-10-18T10:56:00.000-07:002008-10-18T10:56:00.000-07:00I eventually found out that the file path can be o...I eventually found out that the file path can be obtained from a ConfigurationErrorsException. So if the user settings file is corrupt, you can delete the file. I wrote an article <A HREF="http://www.codeproject.com/KB/dotnet/CorruptUserConfig.aspx" REL="nofollow">here</A>.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28314047.post-65119159775620727122008-03-17T01:03:00.000-07:002008-03-17T01:03:00.000-07:00You may use the method OpenExeConfiguration that u...You may use the method OpenExeConfiguration that uses ExeConfigurationFileMap object.In ExeConfigurationFileMap object you should use different configuration file mapping and you will be able <BR/>to validate the file before you access it.Tarashttps://www.blogger.com/profile/08190352805764968698noreply@blogger.comtag:blogger.com,1999:blog-28314047.post-44033865681859160682008-03-16T19:24:00.000-07:002008-03-16T19:24:00.000-07:00Is there a way to get the file path that does not ...Is there a way to get the file path that does not require the user.config file to be valid? I want to, in the case of an invalid user.config, catch the exception and delete the corrupted file.<BR/><BR/>Attempting to use this method just throws a similar exception when the user.config file is corrupt.Anonymousnoreply@blogger.com