I have a DLL with NUnit tests. A few of the tests (not all) in that DLL fail when TeamCity tries to run them as a build step. But when I run them (on the same computer as TC) using a stand-alone version of NUnit (same version) all tests pass.
I have tried to copy the settings from TC the best I can but I'm still getting different results while the tests are being run on the same machine.
When running the NUnit console I'm using the same assembly built by TC.
These are the parameters I'm using in the "nunit-console.exe":
PS Downloads\NUnit-2.6.4\bin> .\nunit-console.exe "pathToDll" /framework:net-4.0 /process:multiple
And this is what I'm using in TC.
These are the TC settings in text:
Any clues to what could be creating this difference or knowledge about how exactly TC is running NUnit so I could try and replicate it on my dev machine?
The actual error I'm getting when the tests are failing through TC is:
System.IO.FileLoadException : Could not load file or assembly 'Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have searched both the entire solution for that assembly and on the computer where TC runs for this version of Castle.Core, which I'm not finding. I don't understand why it's trying to load this file just when it's being run by TC and not any other times...
I've failed to locate the actual NUnit runner that TC is using. Anyone know where that resides?
What I've tried:
Remove every file/folder/dll with the name Castle.Core from the TC computer and rebuilt the project.
Run the NUnit DLL through nunit-console
and nunit GUI
(with or without "project")
Thanks in advance 😊
PS. Yes, I know we should update to NUnit 3 .DS
User contributions licensed under CC BY-SA 3.0