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

Update System.Net.Http reference to use NuGet #10

Closed
tillig opened this issue Aug 27, 2020 · 0 comments
Closed

Update System.Net.Http reference to use NuGet #10

tillig opened this issue Aug 27, 2020 · 0 comments

Comments

@tillig
Copy link
Member

tillig commented Aug 27, 2020

Describe the Bug

When running on .NET 4.6.1, the Autofac.Integration.WebApi.Own assembly appears to reference System.Net.Http 4.0.0.0, but when run on .NET 4.7.1 the reference appears to be System.Net.Http 4.2.0.0 which doesn't exist. This causes runtime failures looking for a missing assembly.

This issue is based on this StackOverflow question.

Steps to Reproduce

Create a project targeting .NET 4.7.1 that uses Autofac.Integration.WebApi.Own 5.0.0. This generates build warnings:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Owin.AutofacWebApiAppBuilderExtensions.UseAutofacWebApi(IAppBuilder app, HttpConfiguration configuration)

Expected Behavior

The version of System.Net.Http should be found and the project should be built without warnings.

Additional Info

The solution, based on searching, appears to be switching the System.Net.Http reference from a framework/assembly reference to a package reference.

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

1 participant