franko_camron
franko_camron

Reputation: 1293

how to add an existing project to a solution with its app.config in .NET 4.0

This might be a silly question but the thing is that I have an existing project named StampCFDI. This project uses it's own app.config file where I store information a web service config.

I recently added this project as reference to an existing solution (FENIXSolution). The problem is that all the config stored in the app.config is not readable in the solution.

I read that I should use the web.config of the current solution because a solution only uses one config file doesn't matter if you have 30 projects on that solution so I added the configurations of the stampCFDI's app.config on the web.config, but the problem persists... I get the error:

Could not find default endpoint element that references contract...

Upvotes: 0

Views: 374

Answers (1)

Andrew Barber
Andrew Barber

Reputation: 40139

The only app/web.config file that applies for any .NET application is the 'final' one, for the program being run. app.config files created in library assembly projects are not used, unless you do some twisting and turning with the file that is outside of the normal deployment process.

(for one thing; app.config is never read at all - it is [program_name.exe.config], which should illustrate the point being made here.)

So, you need to make sure the web.config of the 'current solution' has the correct information in it.

Upvotes: 1

Related Questions