Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

An error occurred while analysing this project after it was built: System.NullReferenceException
Daniele
#1 Posted : Wednesday, October 3, 2012 6:04:59 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2012(UTC)
Posts: 3

Hi All,

first all thanks for Ncrunch. I used in the past without any problem.

Now with a new project (empty for now), just a proof of concept I have this error:

An error occurred while analysing this project after it was built: System.NullReferenceException: Object reference not set to an instance of an object.
at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildSingleFixture(Type type, Attribute attr)
at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildMultipleFixtures(Type type, Attribute[] attrs)
at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildFrom(Type type)
at NUnit.Core.Extensibility.SuiteBuilderCollection.BuildFrom(Type type)
at NUnit.Core.TestFixtureBuilder.BuildFrom(Type type)
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitDynamicTestFinder.FindFrameworkTestsUsingRuntimeInvoke(TestPackage package, ILogger logger, List`1 tests)
at nCrunch.TestExecution.Frameworks.NUnit.NUnitTestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, String assemblyFilePath, String[] referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(TestFrameworkDescription[] applicableFrameworks)


VS 2010
.net 4

this the library on the failed project
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Moq" version="4.0.10827" targetFramework="net40" />
<package id="NUnit" version="2.6.1" targetFramework="net40" />
<package id="structuremap" version="2.6.4.1" targetFramework="net40" />
<package id="structuremap.automocking" version="2.6.4.1" targetFramework="net40" />
</packages>

can anyone help me?

thanks
Daniele
Remco
#2 Posted : Wednesday, October 3, 2012 9:04:39 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi Daniele,

Thanks for posting!

This is an internal NUnit issue that I would guess is being caused somehow by the structure of one of your tests/fixtures. Is there any chance I could take a look at this source code? If you only have a few tests in the project, a copy/paste of this would be fine (if you are able to do so).

Something that may make a difference is to downgrade your NUnit dependency to 2.6.0. I'm not sure if this will have an impact on the other components you are using, though it could help to confirm whether this is problem is related to your NUnit version (1.41b of NCrunch uses NUnit 2.6.0).


Cheers,

Remco
Daniele
#3 Posted : Wednesday, October 3, 2012 10:01:38 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2012(UTC)
Posts: 3

Hi,

I think you are right. In the project where Nchrunch works I use:
<package id="NUnit" version="2.6.0.12054" />

Let me see if I can fix changing the version.

public class AutoMockBase<T> : MockBase where T : class
{
public MoqAutoMocker<T> AutoMocker { get; set; }

#region Setup/Teardown
[SetUp]
public override void SetUp()
{
base.SetUp();
AutoMocker = new MoqAutoMocker<T>();
AutoMocker.MockObjectFactory(); }
.....
}


[TestFixture]
public abstract class MockBase
{
#region Setup/Teardown
[SetUp]
public virtual void SetUp()
{

}
[TearDown]
public virtual void TearDown()
{
Container = null;
}
....
}
Daniele
#4 Posted : Wednesday, October 3, 2012 10:07:50 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/3/2012(UTC)
Posts: 3

let me suggest something if i can:

Will be great if you can make overridable the version of the components like Nunit etc.
Give a better message on the error (the version is quite easy to fix the problem)
Write the requirement fro Ncrunch. I didn't find them anywhere.



for the rest is a great tool.
Remco
#5 Posted : Wednesday, October 3, 2012 10:14:35 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
I'll note the NUnit 2.6.1 issue down to be resolved in a future build, hopefully v1.42. Thanks for making me aware of it!

Cheers,

Remco
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.049 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download