Today when i was working on some test code, i suddenly started getting this errorcould not load file or assembly nunit.core ( look in the end of the entry for the actual stack trace). This was only happening on the build server.
The build server is based on Cruise control and pulls code from subversion. Initially i did the standard Microsoft approach. Reboot:) that did not work. Then i tried Reinstalling NUnit and that did not work.
It turned out to be a config file ( app.config) file issue. Subversion had written merge tags in the app config file. NUnit instread of telling that the issue was about an invalid config, file chokes completelya and gives a completely clueless message.
Once i cleaned up the app config things started working again like a charm:)
Here is the actual stack stace in case some else googles in the future for something similar
System.IO.FileNotFoundException…
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
at System.AppDomain.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
at NUnit.Util.TestDomain.MakeRemoteTestRunner(AppDomain runnerDomain)
at NUnit.Util.TestDomain.Load(String assemblyFileName, String testFixture)
at NUnit.Util.TestLoader.LoadTest(String testName)


