chatcja
chatcja

Reputation: 375

Location of applicationname.exe.config in C#

Where I can find the applicationname.exe.config file in my Windows form application. Where can I find the application exe... mentioned that config file should be placed in Release or Debug files. But I cannot see the file in those places.

Also, I manually copied the config file from project root directory and past it in Release directory. Still the changes are not effected.

Then, I renamed the config as applicationname.exe.config, still the not effected.

Anybody can tell me how can I overcome ?

Upvotes: 0

Views: 1373

Answers (3)

Russell
Russell

Reputation: 17719

It should be in the same folder as applicationname.exe. That is generally where the config files are for win forms applications.

If it is not there, you can create a new one, with the name applicationname.exe.config.

Upvotes: 2

Chuck Savage
Chuck Savage

Reputation: 11945

Try,

string path = Environment.GetCommandLineArgs()[0] + ".config";

Upvotes: 0

Deepika
Deepika

Reputation: 474

Try like this path. i.e, inside bin folder

C:\Documents and Settings\deepika\My Documents\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\bin\Debug    

Upvotes: 0

Related Questions