← Back to team overview

nunit-core team mailing list archive

[Question #172452]: Unhandled Serialization Exception

 

New question #172452 on NUnit Framework:
https://answers.launchpad.net/nunit-3.0/+question/172452

Exploring the Nunit 3.0 Engine API (so keen to be able to use this product) for the first time, trying to pick up, build and run a very simple test. My test lib looks like:

using NUnit.Framework;

namespace ExperimentTests
{
    [TestFixture]
    public class Class1
    {
        [Test]
        public void SimpleTest()
        {
            Assert.Pass();
        }

    }
}


and my experiment to use the engine api looks like:

using System;
using NUnit.Engine;

namespace Experiment
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] testPackageFiles = { @"C:\projects\ExperimentTests.dll" };
            var testPackage = new TestPackage(testPackageFiles);

            var testEngine = TestEngineActivator.CreateInstance();
            var testRunner = testEngine.GetRunner();
            //*
            var testEngineResult = testRunner.Explore(testPackage, TestFilter.Empty);

            Console.WriteLine(testEngineResult.Xml);
            //*/
            Console.ReadLine();

        }
    }
}



When run, NUnitFrameworkDriver.CreateObject throws an unhandled SerializationException "Type is not resolved for member 'NUnit.Engine.RuntimeFramework,nunit.engine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'."

I'm very keen to start exploring the 3.0 api, but I can't seem to get past banging my head off this problem!


Exception Detail:

System.Runtime.Serialization.SerializationException was unhandled
  Message=Type is not resolved for member 'NUnit.Engine.RuntimeFramework,nunit.engine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  Source=mscorlib
  StackTrace:
       at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityAttributes)
       at NUnit.Engine.NUnitFrameworkDriver.CreateObject(String typeName, Object[] args) in C:\projects\nunit3\NUnitEngine\src\nunit.engine\NUnitFrameworkDriver.cs:line 95
       at NUnit.Engine.NUnitFrameworkDriver.Explore(String assemblyFileName, IDictionary`2 settings, TestFilter filter) in C:\projects\nunit3\NUnitEngine\src\nunit.engine\NUnitFrameworkDriver.cs:line 75
       at NUnit.Engine.Runners.DirectTestRunner.Explore(TestPackage package, TestFilter filter) in C:\projects\nunit3\NUnitEngine\src\nunit.engine\Runners\DirectTestRunner.cs:line 60
       at NUnit.Engine.Runners.TestDomainRunner.Explore(TestPackage package, TestFilter filter) in C:\projects\nunit3\NUnitEngine\src\nunit.engine\Runners\TestDomainRunner.cs:line 48
       at NUnit.Engine.Runners.MasterTestRunner.Explore(TestPackage package, TestFilter filter) in C:\projects\nunit3\NUnitEngine\src\nunit.engine\Runners\MasterTestRunner.cs:line 36
       at Experiment.Program.Main(String[] args) in C:\projects\DITTRunner\Experiment\Experiment\Program.cs:line 22
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 


-- 
You received this question notification because you are a member of
NUnit Core Developers, which is an answer contact for NUnit Framework.