I’m currently using visual studio 2008 unit testing to develop a class library, and into the library I put one of my classes that calls a web service. So I added a service reference to the class library.
But when I tried to test something that intantated the web service client, I kept getting weird errors as I ran the unit test.
It turns out that when I copied the app.config from the class library that included the web service definitions into the app.config of the unit testing project, the error went away. I’m not sure why the debugging project needs to have the service definitions.
Advertisement
October 30, 2010 at 9:55 am |
I ran into the same problem.. but if you think about it it’s quite logical unit test are run isolated in a seperate folders and if you don’t specify that the testing framework also needs to deploy the app.config file it will not be copied by the framework… and thus the test will result in an error. So instead of adding the app.config file to your test project, edit the Local.testsettings and tell it to deploy the app.config too.
February 6, 2011 at 1:56 pm |
thanks, helpful point on deployin the particular settings in a separate config file