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

Depending on Microsoft.AspNetCore.Authentication 1.1.0 causes a failure to resolve System.Net.Http when targeting the full framework. #1046

Closed
jkells opened this Issue Nov 22, 2016 · 20 comments

Comments

Projects
None yet
@jkells

jkells commented Nov 22, 2016

Depending on Microsoft.AspNetCore.Authentication 1.1.0 causes a failure to resolve System.Net.Http when targeting the full framework.

Minimal repro steps

I have attached a project that reproduces the issue.
SystemNetHttpClientIssue.zip

  1. Create a NetCore library project and NetCore console project targeting net46
  2. In the Library project depend on NetStandard.Library 1.6.1
  3. In the Library project make use of System.Net.Http
  4. In the console app, reference Microsoft.AspNetCore.Authentication 1.1.0
  5. In the console app reference and use the library project.

Expected result

The application should use System.Net.Http == 4.3.0 as defined in NetStandard 1.6.1 which correctly works on both the core and full framework.

Actual result

The application doesn't copy any System.Net.Http dll into the output folder.

The application will crash with 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.

Further technical details

I believe this issue is related to a problem in the 4.1.0 version of the System.Net.Http package.
dotnet/corefx#9884
dotnet/corefx#9846

With the release of Asp.NET Core 1.1 the issue is fixed across all the packages I'm using except for this one. I believe it's related to this entry in your project.json file.

    "net451": {
      "frameworkAssemblies": {
        "System.Net.Http": ""
      }

Building a custom version of Microsoft.AspNetCore.Authentication without the dependency on "System.Net.Http" from the framework does fix the issue for me.

@RaviDesai

This comment has been minimized.

Show comment
Hide comment
@RaviDesai

RaviDesai Nov 22, 2016

I'm having this issue on a aspnetcore 1.1 app in VisualStudioCode (on my mac) targeting dotnet 5.6 and portable-net45+win8. Just upgraded this app from aspnetcore 1.0, where the reference to System.Net.Http worked fine.

"frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        }
      },
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

It sounds like you have some kind of work-around, but I'm not sure I understand it. Can you elaborate?

RaviDesai commented Nov 22, 2016

I'm having this issue on a aspnetcore 1.1 app in VisualStudioCode (on my mac) targeting dotnet 5.6 and portable-net45+win8. Just upgraded this app from aspnetcore 1.0, where the reference to System.Net.Http worked fine.

"frameworks": {
    "netcoreapp1.1": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.1.0",
          "type": "platform"
        }
      },
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

It sounds like you have some kind of work-around, but I'm not sure I understand it. Can you elaborate?

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Nov 22, 2016

Member

@anurse, @muratg will come talk to you about this.

Member

Eilon commented Nov 22, 2016

@anurse, @muratg will come talk to you about this.

@anurse

This comment has been minimized.

Show comment
Hide comment
@anurse

anurse Nov 23, 2016

Member

This appears to be a packaging issue with our Authentication package. I've updated @muratg and @pranavkm with some information on it, and we'll investigate how best to fix this issue. Unfortunately I haven't been able to find a good workaround, short of downgrading back to net451 which should not exhibit this issue.

Member

anurse commented Nov 23, 2016

This appears to be a packaging issue with our Authentication package. I've updated @muratg and @pranavkm with some information on it, and we'll investigate how best to fix this issue. Unfortunately I haven't been able to find a good workaround, short of downgrading back to net451 which should not exhibit this issue.

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Nov 30, 2016

Member

Yes, I was able to work around this in the given repro app by downgrading the Lib project from net46 to net452.

Member

Tratcher commented Nov 30, 2016

Yes, I was able to work around this in the given repro app by downgrading the Lib project from net46 to net452.

@SteveSandersonMS

This comment has been minimized.

Show comment
Hide comment
@SteveSandersonMS

SteveSandersonMS Dec 5, 2016

Member

@anurse Might this also be the underlying cause for aspnet/JavaScriptServices#487? Please let me know if this is likely to be fixed in 1.1.1.

Member

SteveSandersonMS commented Dec 5, 2016

@anurse Might this also be the underlying cause for aspnet/JavaScriptServices#487? Please let me know if this is likely to be fixed in 1.1.1.

@anurse

This comment has been minimized.

Show comment
Hide comment
@anurse

anurse Dec 5, 2016

Member

It certainly could be related. I don't know exactly what the plan is for fixing the issue in 1.1.1, since I've been OOF for a week, but in theory there are a few cases in our repositories where this issue could arise.

Member

anurse commented Dec 5, 2016

It certainly could be related. I don't know exactly what the plan is for fixing the issue in 1.1.1, since I've been OOF for a week, but in theory there are a few cases in our repositories where this issue could arise.

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Jan 19, 2017

Member

This patch bug is approved. Please use the normal code review process w/ a PR and make sure the fix is in the correct branch, then close the bug and mark it as done.

Member

Eilon commented Jan 19, 2017

This patch bug is approved. Please use the normal code review process w/ a PR and make sure the fix is in the correct branch, then close the bug and mark it as done.

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Jan 19, 2017

Member

Note the frameworkAssemblies references were removed from dev as part of the xproj->csproj conversion. We only need to clean this up in the patch branches.

Member

Tratcher commented Jan 19, 2017

Note the frameworkAssemblies references were removed from dev as part of the xproj->csproj conversion. We only need to clean this up in the patch branches.

@sm-g

This comment has been minimized.

Show comment
Hide comment
@sm-g

sm-g Feb 3, 2017

@anurse your commit in rel/1.1.1 branch, does that mean that AspNetCore 1.1.1 nuget packages will contain it soon? If yes - when?

sm-g commented Feb 3, 2017

@anurse your commit in rel/1.1.1 branch, does that mean that AspNetCore 1.1.1 nuget packages will contain it soon? If yes - when?

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Feb 3, 2017

Member

@sm-g we're working on the 1.1.1 release right now (obviously 😄 ) and we hope to have the official release out within 1 month.

Member

Eilon commented Feb 3, 2017

@sm-g we're working on the 1.1.1 release right now (obviously 😄 ) and we hope to have the official release out within 1 month.

@FelschR

This comment has been minimized.

Show comment
Hide comment
@FelschR

FelschR Feb 10, 2017

Is it right to assume that 1.1.1 will be published before/alongside VS2017's release in March?

FelschR commented Feb 10, 2017

Is it right to assume that 1.1.1 will be published before/alongside VS2017's release in March?

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher
Member

Tratcher commented Feb 10, 2017

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Feb 10, 2017

Member

@FelschR we're still figuring out the details on exactly when the two releases will go live, but it'll certainly be close!

Member

Eilon commented Feb 10, 2017

@FelschR we're still figuring out the details on exactly when the two releases will go live, but it'll certainly be close!

@emirhosseini

This comment has been minimized.

Show comment
Hide comment
@emirhosseini

emirhosseini Feb 10, 2017

What do you mean by Asp.Net Core 1.1.1? There's no such NuGet package. There's "Microsoft.AspNetCore.Mvc" which is already on 1.1.1. Please clarify exactly what you're talking about.

emirhosseini commented Feb 10, 2017

What do you mean by Asp.Net Core 1.1.1? There's no such NuGet package. There's "Microsoft.AspNetCore.Mvc" which is already on 1.1.1. Please clarify exactly what you're talking about.

@Tratcher

This comment has been minimized.

Show comment
Hide comment
@Tratcher

Tratcher Feb 10, 2017

Member

@emirhosseini 1.1.1 is the version of the upcoming patch for this repo.

Member

Tratcher commented Feb 10, 2017

@emirhosseini 1.1.1 is the version of the upcoming patch for this repo.

@marianosz

This comment has been minimized.

Show comment
Hide comment
@marianosz

marianosz Feb 14, 2017

When will be released?

marianosz commented Feb 14, 2017

When will be released?

@Eilon

This comment has been minimized.

Show comment
Hide comment
@Eilon

Eilon Feb 14, 2017

Member

@marianosz the plan is to have it out later this month. We're just nearly done with all the fixes, and we're working on getting the final builds put together and doing additional testing.

Member

Eilon commented Feb 14, 2017

@marianosz the plan is to have it out later this month. We're just nearly done with all the fixes, and we're working on getting the final builds put together and doing additional testing.

@marianosz

This comment has been minimized.

Show comment
Hide comment
@marianosz

marianosz Feb 14, 2017

Thanks for the info!

marianosz commented Feb 14, 2017

Thanks for the info!

@anurse anurse added 3 - Done and removed 2 - Working labels Feb 23, 2017

@marianosz

This comment has been minimized.

Show comment
Hide comment
@marianosz

marianosz May 11, 2017

I'm still facing the same issue with all the packages updated using net462... Any workarounds?

marianosz commented May 11, 2017

I'm still facing the same issue with all the packages updated using net462... Any workarounds?

@Maritims

This comment has been minimized.

Show comment
Hide comment
@Maritims

Maritims Jun 29, 2017

I am also experiencing this issue with everything updated and running net461

Maritims commented Jun 29, 2017

I am also experiencing this issue with everything updated and running net461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment