Skip to content

A package reference to ASP.NET Core 3.0 breaks the test host #1892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JamesNK opened this issue Jan 18, 2019 · 3 comments
Closed

A package reference to ASP.NET Core 3.0 breaks the test host #1892

JamesNK opened this issue Jan 18, 2019 · 3 comments

Comments

@JamesNK
Copy link
Member

JamesNK commented Jan 18, 2019

Steps to reproduce

  1. Install .NET Core SDK 3.0 preview 1
  2. Open attached project - nunittest.zip
  3. Run dotnet test in test directory

Expected behavior

Tests run

Actual behavior

The presence of <PackageReference Include="Microsoft.AspNetCore.App" Version="3.0.0-preview-18579-0056" /> in the test project causes the following error:

C:\Development\Temp\nunittest\PrimeService.Tests> dotnet test
Build started, please wait...
Build completed.

Test run for C:\Development\Temp\nunittest\PrimeService.Tests\bin\Debug\netcoreapp3.0\PrimeService.Tests.dll(.NETCoreApp,Version=v3.0)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
Testhost process exited with error: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.JsonDataSerializer..ctor()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.JsonDataSerializer.get_Instance()
   at Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.TestRequestHandler..ctor(TestHostConnectionInfo connectionInfo)
   at Microsoft.VisualStudio.TestPlatform.TestHost.DefaultEngineInvoker.Invoke(IDictionary`2 argsDictionary)
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Run(String[] args)
   at Microsoft.VisualStudio.TestPlatform.TestHost.Program.Main(String[] args)


Test Run Aborted.
@JamesNK
Copy link
Member Author

JamesNK commented Jan 18, 2019

cc @JunTaoLuo

@natemcmaster
Copy link
Contributor

You need to replace the package reference with <FrameworkReference Include="Microsoft.AspNetCore.App" />. cref dotnet/aspnetcore#3612 The 3.0 Preview 2 SDK will give you warnings about this and make it work - cref dotnet/sdk#2738

@JamesNK
Copy link
Member Author

JamesNK commented Jan 18, 2019

That works. You're a ⭐️

@JamesNK JamesNK closed this as completed Jan 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants