IdentityServer / IdentityServer4.AccessTokenValidation

IdentityServer Access Token Validation for ASP.NET Core
Apache License 2.0
544 stars 214 forks source link

Adding this nuget package removes system.net.http DLL from build #50

Closed TPJ11 closed 7 years ago

TPJ11 commented 7 years ago

Stacked overflow post - http://stackoverflow.com/questions/42556392/updated-system-net-http-dll-not-copied-into-bin-folder-identityserver4-acces

Issue

System.Net.Http DLL not put in bin folder when this nuget package is added

How to replicate

1) If you create a blank .net core API project change it to use .net461 clean your bin folder and build it you will see the System.Net.Http DLL within the folder "bin\Debug\net461\win7-x64".

2) Now add IdentityServer4 AccessTokenValidation to the dependencies

"IdentityServer4.AccessTokenValidation": "1.0.5"

3) Clear your bin folder again

4) Build project and you will see the System.Net.Http DLL is missing.

The project should still work when you run it but I am using a nuget package that needs that missing DLL

TPJ11 commented 7 years ago

As the nuget package that breaks is my own nuget package I have been able to get a work around. Within project.json -> frameworks -> net461 I added system.net.http as a framework assemble leaving the version blank - the version it wants is 4.1.1.0 but I take it leaving it blank means it will take the one it needs? any way both work (blank or with version). I'll fully test this on Monday.

"frameworks": { "net461": { "frameworkAssemblies": { "System.Net.Http": "" } } }

This change was made in the nuget package NOT the API project itself.

This issues seems very closely matching this - https://github.com/aspnet/Security/issues/1046

leastprivilege commented 7 years ago

It used to be a framework assembly. Someone requested to change it because of other issues.

Will review when moving to csproj next week.

leastprivilege commented 7 years ago

We moved IdentityModel2 to the new csproj

Could you try the dev branch - and if this fixes your scenarios?

Just call the build.ps1 in the root - it will produce a nuget

TPJ11 commented 7 years ago

Sorry for the delay - Yes that seems to have fixed it! - I used the dev branch (2.5.1) and 2.6.0 both work (I take it that they are the same code just versioned) all seems good. Thanks!