I played with your concept, and it seems that the problem is not with the file upload, but from the dependencies.
I used the following modified code:
And the error was actually not in finding nunit.core.dll, which is located in the / lib directory.
try { String NUnitPath = @"C:\Program Files\NUnit 2.5.7\bin\net-2.0\nunit-console.exe"; AssemblyName asmName = System.Reflection.AssemblyName.GetAssemblyName(NUnitPath); AppDomain.CurrentDomain.ExecuteAssemblyByName(asmName, new[] { Assembly.GetExecutingAssembly().Location, "/framework:4.0" }); } catch (Exception ex) { Trace.WriteLine(ex.Message); Trace.WriteLine(ex.StackTrace); }
(I like getting System.Reflection.AssemblyName because you can check and see that everything is in order to erase the path to the raw file.)
A quick bulk copy (xcopy nunit. *. Dll) to my debug directory of test projects, and everything went fine. (This should be trivial to find the required minimum dependencies)
Tested in VC # 2010 Express using NUnit 2.5.7 (breakpoints work, but I did not play with other parameters.) Although I'm sure that you can make it passable build with it.
Hurrah!
PS - The first post is here, so I am a little untested regarding how to format blocks of code. Sorry in advance.
Andre White Aug 03 '10 at 1:15 2010-08-03 01:15
source share