"Unable to find assembly" from VS project with output dir outside project dir

Bug #1086733 reported by Stuart Wood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nunit-console
New
Undecided
Unassigned

Bug Description

Version: 2.6.2.12296
I have attached two copies of a basic VS (2005) project with a single serializable class in it, plus a single [TestFixture] class.

The tests are simplistic - the problem one is serializing an instance of the class, then deserializing it back and checking the value is the same. I run the tests using 'nunit-console <path-to-project-file>'. The working directory seems to have no discernible effect, but I've tried within the project dir, solution dir and output dir and the 'failing' project always fails.

In the working project, the output directory is set to "bin/Debug/"; in the failing project, the output directory is set to '../bin". Other than that they are identical.

When I run the tests on the working project, they all run through fine, including the serialization test.
When I try on the failing project, I get the following report :-

NUnit-Console version 2.6.2.12296
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
   OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
  CLR Version: 2.0.50727.3643 ( Net 3.5 )

ProcessModel: Default DomainUsage: Default
Execution Runtime: net-3.5
...F
Tests run: 3, Errors: 1, Failures: 0, Inconclusive: 0, Time: 0.234375 seconds
  Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0

Errors and Failures:
1) Test Error : NUnitTest._UnitTests.NumberTests.TestSerialization
   System.Runtime.Serialization.SerializationException : Unable to find assembly 'NUnitTest, Version=1.0.4722.19557, Culture=neutral, PublicKeyToken=null'.
   at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
   at NUnitTest._UnitTests.NumberTests.TestSerialization() in C:\temp\nunit-examples\NUnitTest-failing\NUnitTest\_UnitTests\NumberTests.cs:line 48

I've quickly tested in the nunit GUI (nunit <path-to-project-file> /run) and that gets the same results.

Revision history for this message
Stuart Wood (sw-bladerunner) wrote :
Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 1086733] [NEW] "Unable to find assembly" from VS project with output dir outside project dir
Download full text (4.4 KiB)

What happens when you run using the path to the test assembly (either
with nunit.exe or nunit-console.exe)?

Charlie

On Wed, Dec 5, 2012 at 3:01 AM, Stuart Wood <email address hidden> wrote:
> Public bug reported:
>
> Version: 2.6.2.12296
> I have attached two copies of a basic VS (2005) project with a single serializable class in it, plus a single [TestFixture] class.
>
> The tests are simplistic - the problem one is serializing an instance of
> the class, then deserializing it back and checking the value is the
> same. I run the tests using 'nunit-console <path-to-project-file>'. The
> working directory seems to have no discernible effect, but I've tried
> within the project dir, solution dir and output dir and the 'failing'
> project always fails.
>
> In the working project, the output directory is set to "bin/Debug/"; in
> the failing project, the output directory is set to '../bin". Other than
> that they are identical.
>
> When I run the tests on the working project, they all run through fine, including the serialization test.
> When I try on the failing project, I get the following report :-
>
> NUnit-Console version 2.6.2.12296
> Copyright (C) 2002-2012 Charlie Poole.
> Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
> Copyright (C) 2000-2002 Philip Craig.
> All Rights Reserved.
>
> Runtime Environment -
> OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
> CLR Version: 2.0.50727.3643 ( Net 3.5 )
>
> ProcessModel: Default DomainUsage: Default
> Execution Runtime: net-3.5
> ...F
> Tests run: 3, Errors: 1, Failures: 0, Inconclusive: 0, Time: 0.234375 seconds
> Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
>
> Errors and Failures:
> 1) Test Error : NUnitTest._UnitTests.NumberTests.TestSerialization
> System.Runtime.Serialization.SerializationException : Unable to find assembly 'NUnitTest, Version=1.0.4722.19557, Culture=neutral, PublicKeyToken=null'.
> at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
> at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
> at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
> at System.Runtime.Serialization.Formatters.Binary.ObjectMap.Create(String name, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler...

Read more...

Revision history for this message
Stuart Wood (sw-bladerunner) wrote :

> What happens when you run using the path to the test assembly (either
> with nunit.exe or nunit-console.exe)?

Passing the outputted dll directly? I get a full pass :-

 C:\>"C:\Program Files\NUnit\bin\nunit-console.exe" C:\temp\NUnitTest-failing\bin\NUnitTest.dll
 NUnit-Console version 2.6.2.12296
 Copyright (C) 2002-2012 Charlie Poole.
 Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
 Copyright (C) 2000-2002 Philip Craig.
 All Rights Reserved.

 Runtime Environment -
    OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
   CLR Version: 2.0.50727.3634 ( Net 3.5 )

 ProcessModel: Default DomainUsage: Single
 Execution Runtime: net-3.5
 ...
 Tests run: 3, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.171875 seconds
   Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0

All good in the GUI too. If I've misunderstood the question, please correct me and I'll try again.

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 1086733] Re: "Unable to find assembly" from VS project with output dir outside project dir

So, this test indicates that your assembly is fine - as we would
expect from your other experiences.

Therefore there's either something wrong with the VS project file or
with the NUnit code that reads it. We'll investigate further.

Charlie

On Wed, Dec 5, 2012 at 2:57 PM, Stuart Wood <email address hidden> wrote:
>> What happens when you run using the path to the test assembly (either
>> with nunit.exe or nunit-console.exe)?
>
> Passing the outputted dll directly? I get a full pass :-
>
> C:\>"C:\Program Files\NUnit\bin\nunit-console.exe" C:\temp\NUnitTest-failing\bin\NUnitTest.dll
> NUnit-Console version 2.6.2.12296
> Copyright (C) 2002-2012 Charlie Poole.
> Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
> Copyright (C) 2000-2002 Philip Craig.
> All Rights Reserved.
>
> Runtime Environment -
> OS Version: Microsoft Windows NT 5.1.2600 Service Pack 3
> CLR Version: 2.0.50727.3634 ( Net 3.5 )
>
> ProcessModel: Default DomainUsage: Single
> Execution Runtime: net-3.5
> ...
> Tests run: 3, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.171875 seconds
> Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
>
> All good in the GUI too. If I've misunderstood the question, please
> correct me and I'll try again.
>
> --
> You received this bug notification because you are subscribed to NUnit
> Extended Testing Platform.
> https://bugs.launchpad.net/bugs/1086733
>
> Title:
> "Unable to find assembly" from VS project with output dir outside
> project dir
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nunitv2/+bug/1086733/+subscriptions

affects: nunitv2 → nunit-console
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.