NUnit console runner fails to load assemblies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NUnit Framework |
Fix Released
|
Medium
|
Charlie Poole | ||
NUnit V2 |
Fix Released
|
Medium
|
Charlie Poole |
Bug Description
I am using NUnit 2.9.4 which I have downloaded as source and compiled with VS2010 RC.
I had trouble loading my test assemblies running the test-runner.exe gives the following output:
-------
PS C:\projects\
TestRunner version 1.0.0
Copyright c 2009 Charlie Poole
Runtime Environment -
OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
.NET Version: 4.0.30128.1
Options -
Use Same AppDomain
Could not load file or assembly 'Specs.Test' or one of its dependencies. The system cannot find the file specified.
PS C:\projects\
-------
If I change the method Load on the class DefaultTestAsse
private Assembly Load(string path)
{
// Throws if this isn't a managed assembly or if it was built
// with a later version of the same assembly.
// TODO: Figure out why we can't load using the assembly name
// in all cases. Might be a problem with the tests themselves.
if (assembly != null)
return assembly;
}
to
private Assembly Load(string path)
{
// Throws if this isn't a managed assembly or if it was built
// with a later version of the same assembly.
// TODO: Figure out why we can't load using the assembly name
// in all cases. Might be a problem with the tests themselves.
if (assembly != null)
return assembly;
}
I can load my assemblies. -The difference in the code is that the Assembly.Load call takes the AssemblyName instead of the path.
With the code change the test-runner output is:
PS C:\projects\
TestRunner version 1.0.0
Copyright c 2009 Charlie Poole
Runtime Environment -
OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
.NET Version: 4.0.30128.1
Options -
Use Same AppDomain
Tests run: 6, Errors: 0, Failures: 0, Inconclusive: 0
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
Time: 0,031 seconds
PS C:\projects\
Related branches
Changed in nunit-3.0: | |
status: | Triaged → Fix Committed |
Changed in nunitv2: | |
status: | Triaged → Fix Committed |
milestone: | none → 2.5.7 |
Changed in nunit-3.0: | |
status: | Fix Committed → Fix Released |
Changed in nunitv2: | |
status: | Fix Committed → Fix Released |
This is a valid bug - thanks for reporting it. Just one note for your
information, however...
test-runner.exe is _not_ the new nunit-console runner. It's merely a program
used to test
the framework itself. There will be a new nunit-console runner for NUnit
3.0... it's just
not out there yet.
Charlie
On Thu, Jun 17, 2010 at 2:00 PM, Christian Horsdal <email address hidden>wrote:
> Public bug reported: ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------ Specs\Specs. Test\bin\ Debug> .\..\NUnit\ NUnit-2. 9.4\solutions\ vs2010\ bin\Debug\ test-runner. exe Specs\Specs. Test\bin\ Debug> ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----- mblyBuilder in 9.4\src\ framework\ Internal\ DefaultTestAsse mblyBuilder. cs from GetAssemblyName (Path.GetFileNa me(path) ); Load(Path. GetFileNameWith outExtension( path)); Host.InstallAdh ocExtensions( assembly) ; Info("Loaded assembly " + assembly.FullName); GetAssemblyName (Path.GetFileNa me(path) ); Load(assemblyNa me); Host.InstallAdh ocExtensions( assembly) ; Info("Loaded assembly " + assembly.FullName);
>
> I am using NUnit 2.9.4 which I have downloaded as source and compiled with
> VS2010 RC.
> I had trouble loading my test assemblies running the test-runner.exe gives
> the following output:
>
>
> -------
>
> PS C:\projects\
> ..\..\.
> .\Specs.Test.dll
> TestRunner version 1.0.0
> Copyright c 2009 Charlie Poole
>
> Runtime Environment -
> OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
> .NET Version: 4.0.30128.1
>
> Options -
> Use Same AppDomain
>
> Could not load file or assembly 'Specs.Test' or one of its dependencies.
> The system cannot find the file specified.
> PS C:\projects\
>
>
> -------
>
> If I change the method Load on the class DefaultTestAsse
> the file
> NUnit-2.
>
>
> private Assembly Load(string path)
> {
> Assembly assembly = null;
>
> // Throws if this isn't a managed assembly or if it was built
> // with a later version of the same assembly.
> AssemblyName assemblyName =
> AssemblyName.
>
> // TODO: Figure out why we can't load using the assembly name
> // in all cases. Might be a problem with the tests themselves.
> assembly =
> Assembly.
>
> if (assembly != null)
> CoreExtensions.
>
> InternalTrace.
>
> return assembly;
> }
>
>
> to
>
>
> private Assembly Load(string path)
> {
> Assembly assembly = null;
>
> // Throws if this isn't a managed assembly or if it was built
> // with a later version of the same assembly.
> AssemblyName assemblyName =
> AssemblyName.
>
> // TODO: Figure out why we can't load using the assembly name
> // in all cases. Might be a problem with the tests themselves.
> assembly = Assembly.
>
> if (assembly != null)
> CoreExtensions.
>
> InternalTrace.
>
> return assembly;
> }
>
>
> I can load my assemblies. -The difference in the code is that the
> Assembly.Load call takes t...