Skip to content
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

MissingMethodException when referencing Microsoft.AspNetCore.TestHost in a .NET Core project that targets net461 #1649

Closed
dfaivre opened this issue Feb 1, 2017 · 3 comments
Labels

Comments

@dfaivre
Copy link

dfaivre commented Feb 1, 2017

Reproduction code here: https://github.com/dfaivre/bugrepro_dotnetcore_missingmethod

It is only my best guess that this is an MSBuild issue with the "new" csproj format. Maybe it's a NuGet issue? Or possibly the an issue with the way the library is packaged? Sorry if I'm wasting your time.

Summary
Using VS2016 RC, when referencing Microsoft.AspNetCore.TestHost (https://www.nuget.org/packages/Microsoft.AspNetCore.TestHost/) nuget package in a .NET Core project that targets net461, a MissingMethodException
is thrown when trying to create an HttpClient:

Error Message:
 System.MissingMethodException : 
   Method not found: 'System.Net.Http.HttpClient Microsoft.AspNetCore.TestHost.TestServer.CreateClient()'.

It is also thrown when creating a "classic" .NET Framework class library and using PackageReferences for NuGet.

The exception is not thrown when targeting netcoreapp1.0, or when creating a "classic" .NET Framework class library using packages.config for NuGet.

System Info

Microsoft Visual Studio Professional 2017 RC
Version 15.0.26127.0 D15REL
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

ASP.NET and Web Tools 2016   15.0.30124.0
ASP.NET and Web Tools 2016

ASP.NET Web Frameworks and Tools 2013   5.2.50105.0
For additional information, visit https://www.asp.net/

NuGet Package Manager   4.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

As a small aside, the new csproj format looks really promising -- thanks for the great work!

@dfaivre
Copy link
Author

dfaivre commented Feb 1, 2017

I also created an issue with aspnet/Hosting group incase it's just a matter of them not having updated their nuget package?

@dfaivre
Copy link
Author

dfaivre commented Feb 1, 2017

Looks like it has to do with the Test SDK according to @anurse: microsoft/vstest#428

@rainersigwald
Copy link
Member

Great, thanks for following up. I'm going to close this--if the investigation comes back to MSBuild behavior, please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants