nunit3 issue with coreapp2.0









up vote
0
down vote

favorite












I try to run nunit test with cake (and manually). I have the following .csproj



 <ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net40' and '$(TargetFramework)' != 'net45'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
</ItemGroup>


When I execute the following command:
nunit3-console.exe myDLL.Test.dll



Same issue with the following cake script



var settings = new NUnit3Settings();
NUnit3(testAssembly.ToString(), settings);


I have the following stacktrace



1) Error :
NUnit.Engine.NUnitEngineException : The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.
----> System.Runtime.Serialization.SerializationException : Le type 'NUnit.Framework.Api.FrameworkController' dans l'assembly 'nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' n'est pas marqué comme sérialisable.
--NUnitEngineException
The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.

Server stack trace:
à NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
à NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
à NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
à NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
à NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)


How can I resolve it ? Thanks










share|improve this question





















  • What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
    – Lex Li
    Nov 10 at 22:46










  • I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
    – Marcus X
    Nov 11 at 15:15










  • A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
    – Lex Li
    Nov 11 at 15:26














up vote
0
down vote

favorite












I try to run nunit test with cake (and manually). I have the following .csproj



 <ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net40' and '$(TargetFramework)' != 'net45'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
</ItemGroup>


When I execute the following command:
nunit3-console.exe myDLL.Test.dll



Same issue with the following cake script



var settings = new NUnit3Settings();
NUnit3(testAssembly.ToString(), settings);


I have the following stacktrace



1) Error :
NUnit.Engine.NUnitEngineException : The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.
----> System.Runtime.Serialization.SerializationException : Le type 'NUnit.Framework.Api.FrameworkController' dans l'assembly 'nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' n'est pas marqué comme sérialisable.
--NUnitEngineException
The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.

Server stack trace:
à NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
à NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
à NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
à NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
à NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)


How can I resolve it ? Thanks










share|improve this question





















  • What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
    – Lex Li
    Nov 10 at 22:46










  • I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
    – Marcus X
    Nov 11 at 15:15










  • A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
    – Lex Li
    Nov 11 at 15:26












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I try to run nunit test with cake (and manually). I have the following .csproj



 <ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net40' and '$(TargetFramework)' != 'net45'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
</ItemGroup>


When I execute the following command:
nunit3-console.exe myDLL.Test.dll



Same issue with the following cake script



var settings = new NUnit3Settings();
NUnit3(testAssembly.ToString(), settings);


I have the following stacktrace



1) Error :
NUnit.Engine.NUnitEngineException : The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.
----> System.Runtime.Serialization.SerializationException : Le type 'NUnit.Framework.Api.FrameworkController' dans l'assembly 'nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' n'est pas marqué comme sérialisable.
--NUnitEngineException
The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.

Server stack trace:
à NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
à NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
à NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
à NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
à NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)


How can I resolve it ? Thanks










share|improve this question













I try to run nunit test with cake (and manually). I have the following .csproj



 <ItemGroup>
<PackageReference Include="NUnit" Version="3.9.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net40' and '$(TargetFramework)' != 'net45'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.9.0" />
</ItemGroup>


When I execute the following command:
nunit3-console.exe myDLL.Test.dll



Same issue with the following cake script



var settings = new NUnit3Settings();
NUnit3(testAssembly.ToString(), settings);


I have the following stacktrace



1) Error :
NUnit.Engine.NUnitEngineException : The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.
----> System.Runtime.Serialization.SerializationException : Le type 'NUnit.Framework.Api.FrameworkController' dans l'assembly 'nunit.framework, Version=3.9.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb' n'est pas marqué comme sérialisable.
--NUnitEngineException
The NUnit 3 driver cannot support this test assembly. Use a platform specific runner.

Server stack trace:
à NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
à NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
à NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
à NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
à NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
à System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
à System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)


How can I resolve it ? Thanks







nunit asp.net-core-2.0






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 21:50









Marcus X

355




355











  • What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
    – Lex Li
    Nov 10 at 22:46










  • I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
    – Marcus X
    Nov 11 at 15:15










  • A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
    – Lex Li
    Nov 11 at 15:26
















  • What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
    – Lex Li
    Nov 10 at 22:46










  • I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
    – Marcus X
    Nov 11 at 15:15










  • A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
    – Lex Li
    Nov 11 at 15:26















What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
– Lex Li
Nov 10 at 22:46




What kind of project do you want to run? .NET Core projects in general should be executed via dotnet test.
– Lex Li
Nov 10 at 22:46












I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
– Marcus X
Nov 11 at 15:15




I try to run net40;net45;netcoreapp2.0 project. net40 and net45 are good but I would like use the same script with netcoreapp2.0 configuration.
– Marcus X
Nov 11 at 15:15












A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
– Lex Li
Nov 11 at 15:26




A multitargeting project can of course be executed by dotnet test. My example github.com/lextm/sharpsnmplib/blob/master/Tests/CSharpCore/…
– Lex Li
Nov 11 at 15:26

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243755%2fnunit3-issue-with-coreapp2-0%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53243755%2fnunit3-issue-with-coreapp2-0%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Barbados

How to read a connectionString WITH PROVIDER in .NET Core?

Node.js Script on GitHub Pages or Amazon S3