views:

20

answers:

2

Hello everybody.

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#.

Thanks!

A: 

When you compile your project the app.config is compiled as [exe].config.

If you want to change configuration you can change the content of [exe].config (it's a plain text document).

fampinheiro
Thanks for the quick answer. I think it's different with a Visual Studio package. It doesn't compile as an executable, but as a dll and a vsix, but true, the method is similar.I would prefer not to change anything in the devnev.exe.config file.
Andrei
A: 

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.

Andrei