Debugger deletes my .config file

S

Scott Juskiw

Every time I try to debug a windows forms app in .NET 1.1
the debugger deletes the app's .config file. This only
happens with new 1.1 projects, it doesn't happen with
projects created in 1.0 that are converted to 1.1. Has
anybody else seen this? Here's an example of what I'm
doing:

1. create a new windows forms app (App.exe)
2. create a config file (App.exe.config)
3. put the App.exe.config file into bin\Debug
4. hit F5 to start debugging, the App.exe.config file
disappears

If I simply double-click on App.exe in bin\Debug, the
App.exe.config file isn't deleted. So it must be something
going on with the debugger.

Anybody know how to fix this?
 
M

Michael Giagnocavo [MVP]

You shouldn't have to copy the app.config file, VS.NET will do it manually.

-mike
MVP
 
J

Jay B. Harlow [MVP - Outlook]

Scott,
Because of the ability to set which version of the runtime should be used,
VS.NET 2003 always replaces the myproject.exe.config in the output folder,
the bin folder.

You need to add your config file to your VS.NET project's root folder as
app.config, it needs to be named "app.config" without the quotes. When you
build your project VS.NET (both 2002 & 2003) will copy the app.config file
from the project root to your output folder and name it appropriately
(myproject.exe.config).

Hope this helps
Jay
 
S

Scott Juskiw

I had erroneously named the "app.config" file
as "app.exe.config" and thus .NET wasn't copying it for
me. Oops.
 
H

Herfried K. Wagner [MVP]

* "Scott Juskiw said:
Every time I try to debug a windows forms app in .NET 1.1
the debugger deletes the app's .config file. This only
happens with new 1.1 projects, it doesn't happen with
projects created in 1.0 that are converted to 1.1. Has
anybody else seen this? Here's an example of what I'm
doing:

1. create a new windows forms app (App.exe)
2. create a config file (App.exe.config)
3. put the App.exe.config file into bin\Debug

Put it into the project's source folder instead and reference it from
the project. VS.NET will copy it to the debug folder automatically.
That's a "bugfix" from version 2002 -> 2003.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 

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