I have a class library that interacts with a WCF service, and uses an app.config
file for its configuration. I'd like to unit test this class, but when I run my unit test, I get:
Could not find default endpoint element that references contract 'FooService' in the service model client configuaration section. This might be because no configuration file was found for your application or because no end point element matching this contract could be found in the client element
According to this answer, I need the app.config
file to reside within my unit test project, and indeed this solves the problem. But I really don't want to have to copy my app.config
file around to unit tests every time I change it.
I suppose I could add a link to the app.config
, except that I'm using SlowCheetah to handle app.config
transformations, so my app.config
is generated at compile time.
Is there anything I can do to get this to work, or do I just have to give up on my app.config
and handle the configuration in code?