Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

Failure to resolve System.Net.Http when targeting the full framework #935

Closed
rocco337 opened this issue Feb 9, 2017 · 3 comments
Closed

Comments

@rocco337
Copy link

rocco337 commented Feb 9, 2017

Hi,

I have test project that is testing api inside aps.net core project. For testing server I am using TestHost. Tests are failing with error that HTTP client dll cannot be loaded:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
....
=== Pre-bind state information ===
LOG: DisplayName = System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/.../bin/Debug/net461/win7-x64/
LOG: Initial PrivatePath = NULL
Calling assembly : Api, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:....\bin\Debug\net461\win7-x64\dotnet-test-xunit.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

I don't have anywhere explicit dependency on HttpClient. While googling for solution I found same problem, just with different package: aspnet/Security#1046

Has anyone else experienced issue like this?

@Tratcher
Copy link
Member

Tratcher commented Feb 9, 2017

Are you targeting .NET 4.6?

@Tratcher
Copy link
Member

Tratcher commented Feb 9, 2017

Related: #926

@glennc
Copy link
Member

glennc commented Feb 9, 2017

Looks the same as #926, if not feel free to open this again.

@glennc glennc closed this as completed Feb 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants