There seem to be known issues with some of the NuGet-distributed .NET Core libraries that are could cause problems for users with .NET 4.6 apps that update to the latest versions of AutoMapper (with .NETStandard targetFramework usage in the nuspec file).
In my case, specifically, we are affected by a problem with System.Net.Http v4.1.0.0 when used in conjunction with System.Net.Http.Formatting. This issue is known and described here.
The thread mentions other assembly with similar problems, like System.IdentityModel.Tokens.Jwt.
You've gotta be shitting me. So what problems does this cause for you? Just completely breaks?
Unfortunately, yeah - our OWIN-based WebAPI will not start at all when this condition exists. It throws that exception right when we instantiate the HttpConfiguration.
And what's the offending package? The System.Net one?
And do you have anything else that depends on System.Net? I could put out a version that only has specific package dependencies - but that's not going to help if something you have also uses the 4.1 of System.Net.Http
Yeah, specifically it's the package System.Net.Http (which is part of NETStandard.Library v1.6). Unfortunately, we do use both System.Net and System.Net.Http so I think we're kind of stuck until they straighten it out.
And you can't downgrade then?
I can definitely downgrade to an older version that isn't using .NETStandard (we were still using 3.3.1 before this). I did try the fix they suggested in the issue (removing the reference to System.Net.Http v4.1.0.0 and replacing it with the Framework version), but that uncovered a chain reaction of other problems. I just wanted to bring it to your attention since other users could feasibly run into the same problem and the exception is so strange.
Sorry, I just re-read and realized I misinterpreted what you said. Yes, we do have a dependency on System.Net.Http but we are not dependent on 4.1. However, there isn't a specific reason for our move to AutoMapper 5 outside of catching back up. So, I wouldn't really blame you if you don't want to pull out your specific package dependencies.
Sigh, there's no timeline on fixing the issue from that issue either, just "1.1"
Yeah, I thought that was a little crazy, especially considering it is not meeting their own standards for compatibility with existing desktop applications - I would hope they did not wait until November to push a fix.
workaround for now is to put a binding redirect in the app.config to force System.Net.Http to 4.0.0.0 on the desktop framework.
@onovotny can you helpme with this? I'm with no lucky trying to creating that binding.
I added a dependency "NETStandard.Library": "1.6.1" to project.json (vs2015) and it loaded fine.
The problem was that I got this Exception:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types
project.json is basically broken...you cannot really use VS 2015 for .NET Standard projects. You should move to VS 2017 and csproj for that.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
workaround for now is to put a binding redirect in the app.config to force System.Net.Http to 4.0.0.0 on the desktop framework.