Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing the config file in a Visual Studio Package

I'm building a Visual Studio Package and associated with it, I have an app.config file (which contains some information about connecting to a WCF service).

As far as I can tell, this package is actually connecting to the devnev.exe.config configuration file (if I use AppDomain.CurrentDomain.SetupInformation.ConfigurationFile), it will retrieve the path to the devnev.exe.config

Firstly, is this correct? Shouldn't the package automatically pick up the app.config file? If this is the case, then how can I make the project use the app.config file?

I'm running VS2010 Ultimate, programming in C#.

like image 229
Alex Avatar asked May 18 '10 08:05

Alex


1 Answers

A Visual Studio Package will take the devnev.exe.config configuration file as its main configuration file. If you add an app.config file into the project, it will not accept it. This is because the package is running within Visual Studio, therefore it is accepting Visual Studio's config file.

At the same time it is not good practice to change the devnev.exe.config file, since once you deploy your application, the user will also have to change that file (and on the whole, you shouldn't change that file).

What I ended up doing is connecting to the WCF service programmatically.

Hope this helps somebody.

like image 182
Alex Avatar answered Sep 30 '22 19:09

Alex