Application configuration file is deleted when you build the solution (822752)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual J# 2005 Express Edition
- Microsoft Visual J# .NET (2003)
SYMPTOMSWhen you build a solution (for example, a console
application, a Microsoft Windows application, or a Microsoft Windows service) in
Microsoft Visual Studio .NET 2003 or in Microsoft Visual Studio 2005, the application configuration file in the
output folder is deleted. CAUSEThis behavior may occur if you manually add the ApplicationName.exe.config file to the output folder or if you use Solution Explorer to add the ApplicationName.exe.config file to the output folder.
Note ApplicationName is a placeholder for the name of the application.RESOLUTIONTo avoid this behavior, add an application configuration
file to your project, and then copy the contents of original configuration file
to the new application configuration file. Follow these steps to add an
application configuration file to the project:
- On Project menu, click Add New
Item.
- In the Add New Item dialog box, under
Templates, click Application configuration
file. Make sure that the file name is App.config, and then click
Open.
- Copy the contents of the original application configuration
file to the new application configuration file.
- On Build menu, click Rebuild
Solution.
- Verify the existence of the configuration file in the
\Bin\Debug folder, and then verify the contents of the \Bin\Debug folder. If
you build the solution in Release mode, check the contents of
the configuration file in the \Bin\Release folder.
Note If you change the default name of the application configuration file
to something different from App.config, the new name is added to your source
files, and then the build system does not generate the output configuration
file. STATUS This
behavior is by design.
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbprb kbConfig kbIDEProject KB822752 kbAudDeveloper |
---|
|