UTF-8 changes to Windows-1252 in config file

  • Thread starter Thread starter Lisa
  • Start date Start date
L

Lisa

Suddenly, the encoding in my exe.config file changes from UTF-8 to
Windows-1252 every time I try to debug my winform app. This causes the old
application configuration error when I try to debug the app. How can I
finally convince my exe.config file to keep straight?
 
Good idea, but making the config file read-only results in this error
message in the debugger:

app.config: Error copying the application configuration file to the run
directory. Access is denied. Could not copy temporary files to the output
directory.

Grrr
 
Lisa,
Are you using VS.NET 2002 or VS.NET 2003?

Where are you setting the format to UTF-8?

Because of the ability to set which version of the runtime should be used,
VS.NET 2003 always replaces the app.config in the output 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).

My concern is you have a copy of the app.config in your project, but you
saved a UTF-8 copy in the output folder. Which will cause it to be replaced
when you build. Or you have a UTF-8 app.config in your project & VS.NET is
changing the format when it copies...

Hope this helps
Jay
 
Back
Top