Windows configuration file
-
I am facing a problem where the configuationfile from the bin directory gets deleted every time i run my windows application. I want to know where to place the windows configuration file. And why does it get deleted. shelly
-
I am facing a problem where the configuationfile from the bin directory gets deleted every time i run my windows application. I want to know where to place the windows configuration file. And why does it get deleted. shelly
Because every time you do a complete rebuild of the application, the output directories get cleaned out. You might want to try putting the .INI file either in the application project folder or where the application can find it on the Path, like in the %WINDIR% folder, which, BTW, is not always C:\WINDOWS. By putting it in the application project folder, this folder will not get cleaned out when you rebuild your project. If your code is written correctly, it will not assume that the current directory is whatever directory the app was launched from. Instead, your code should ask the system from what directory is was launched from, then look in the directory for the configuration file. Check into storing Application.StartupPath and/or Environment.CurrentDirectory when your application starts and using it later to locate your configuration file. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Because every time you do a complete rebuild of the application, the output directories get cleaned out. You might want to try putting the .INI file either in the application project folder or where the application can find it on the Path, like in the %WINDIR% folder, which, BTW, is not always C:\WINDOWS. By putting it in the application project folder, this folder will not get cleaned out when you rebuild your project. If your code is written correctly, it will not assume that the current directory is whatever directory the app was launched from. Instead, your code should ask the system from what directory is was launched from, then look in the directory for the configuration file. Check into storing Application.StartupPath and/or Environment.CurrentDirectory when your application starts and using it later to locate your configuration file. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
hi I want to use the .exe.config file. I copied to the main project folder. Then also it is not reading the file. Please tell me from where all the application reads the exe.config file. Secondly, I created an .ini file also. I copied .ini file to bin, debug and project folder. I set the project output folder to first to bin then to debug. But the problem remains. please help shelly
-
Because every time you do a complete rebuild of the application, the output directories get cleaned out. You might want to try putting the .INI file either in the application project folder or where the application can find it on the Path, like in the %WINDIR% folder, which, BTW, is not always C:\WINDOWS. By putting it in the application project folder, this folder will not get cleaned out when you rebuild your project. If your code is written correctly, it will not assume that the current directory is whatever directory the app was launched from. Instead, your code should ask the system from what directory is was launched from, then look in the directory for the configuration file. Check into storing Application.StartupPath and/or Environment.CurrentDirectory when your application starts and using it later to locate your configuration file. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Dave Kreskowiak wrote: Because every time you do a complete rebuild of the application, the output directories get cleaned out Actually this is not true. I have multiple applications that have INI files in the Debug & Release directories and they are not effected in any way when performing any build type in the build menu of VS.NET. Are you talking about some action other than those in the build menu ?