NUnit & the dll.config problem
I've been trying to get some integration tests working in NUnit, and I ran into a problem which took quite a while to figure out. When I ran my tests I would get an error to the effect that myAssembly.dll.config was missing. The actual error message looked something like this:
System.Exception : the binding "..." as not found. Are you missing the configuration file: "C:\Users\JSCHRAG\AppData\Local\Temp\nunit20\ShadowCopyCache\13740_324684314354321453\Tests_239482734597|assembly\d13\blah\blah\myAssembly.dll.config"
Essentially, I believe that NUnit is trying to run the tests in its own app domain, and it can't find the config file in its temp folder. Every blog, forum posting, etc. that I could find said to simply put the config file in the same folder with the dll (in my case, the bin folder). I tried every combination of this I could think of with no luck.
The thing that finally worked was running the tests in the primary domain. Details here: http://www.nunit.org/index.php?p=consoleCommandLine&r=2.5.10.
The resulting command looked like this:
nunit-console /domain:None myAssembly.dll
System.Exception : the binding "..." as not found. Are you missing the configuration file: "C:\Users\JSCHRAG\AppData\Local\Temp\nunit20\ShadowCopyCache\13740_324684314354321453\Tests_239482734597|assembly\d13\blah\blah\myAssembly.dll.config"
Essentially, I believe that NUnit is trying to run the tests in its own app domain, and it can't find the config file in its temp folder. Every blog, forum posting, etc. that I could find said to simply put the config file in the same folder with the dll (in my case, the bin folder). I tried every combination of this I could think of with no luck.
The thing that finally worked was running the tests in the primary domain. Details here: http://www.nunit.org/index.php?p=consoleCommandLine&r=2.5.10.
The resulting command looked like this:
nunit-console /domain:None myAssembly.dll
Comments
Post a Comment