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
Strange issue with System.Net.Http 4.2.0.0 not found #155
Comments
Probably mine is kind of similar to issue #154 - but still I'm looking for a solution... |
So @oliverbes were you able to get to the bottom of this? Looks like Sven just started using the new C# project system format and that fixed things for him. |
Sorry, was busy with other stuff. Hope to continue on this soon. |
Experiencing a similar issue. I've got a project using 4.6.1 and ASP.Net Core 1.1. Everything seems to work fine when I deploy to the local cluster or deploy to Azure via Visual Studio, but when I deploy to Azure with the scripts I get a ReflectionTypeLoadException.
When I dig into Loader exceptions I get the following: The issue does seem to be tied to eventflow, I don't think anything else has the System.Net.Http dependency and this is the only new dependency I've added. That and I had to upgrade the application from 4.5.2 to 4.6.1 to support eventflow. |
@alexszym verify that your cluster actually has 4.6.1 installed After that it is most likely that what you are seeing is related to dotnet issue 481 so please apply all the workarounds mentioned in that issue and let us know if that helped! |
Closing this one for now, but please reopen as necessary |
Not a reopen request but the issue can still happen but I have a work around. Upgraded project to 4.7.2. Went through all the bells and whistles necessary. Go to run finally and get the File not found exception looking for a 4.2.0.0 version of System.Net.Http... Turns out Visual Studio 2017, when installing the .NET 4.3.3 Nuget package for System.Net.HTTP is also adding DLL reference (old school) from the GAC. This in tandem with an Assembly redirect causes run time System.IO.FileNotFoundException looking for version 4.2.0.0 of System.Net.Http. The good news, is to add references, uncheck System.Net.Http from the GAC (which was added automatically or by other developers in the project at one point in time), and simply delete the Assembly redirect. Issue was gone after that. |
Thanks for sharing @thyams, appreciate your help. |
@thyams Could you elaborate a bit on what you did? I have the same issue now, but I can't follow the steps you did to fix this issue. What do you mean by Also, what do you mean by |
@melwil I will let @thyams provide the definitive reply but typically
So I would look into these two kinds of files with a text editor (notepad or similar) and look for suspicious entries for System.Net.Http (wrong version and/or referring to GAC as opposed to standard Nuget feed). Hope this helps! |
I have a strange issue, which drives me crazy…
I have a simple Class Library Project (Full .NET Framework, 4.6.1) with a wrapper class for functionality around Cosmos DB. Therefore I have added the “Microsoft.Azure.DocumentDB” NuGet Package 1.19.1 to this project. Other than that, I have a reference to the “Newtonsoft.Json” NuGet Package 10.0.3, as well as to a couple of "Microsoft.Diagnostics.EventFlow.*" NuGet Packages.
So far, everything compiles without any error.
But as soon as I hit my wrapper class – consumed from a simple Service Fabric Stateless Service (Full .NET Framework 4.6.1) – and try to execute the following line of code:
_docClient = new DocumentClient(new Uri(cosmosDbEndpointUrl), cosmosDbAuthKey);
I get this strange error at runtime:
I have absolutely no clue, why the System.Net.Http assembly is not found at all – there is no direct assembly reference in my class library project to the .Net Framework Assembly “System.Net.Http”.
What I also do not understand is, that there is this weird binding redirect to 4.2.0.0 – where is that one coming from? To get around this one, I tried to add the following redirect to the app.config of the Service Fabric Service (which is consuming the class library).
In a Service Fabric Service without any of the EventFlow NuGet Packages I have no runtime error at all, everything works as expected. From that, my assumption is about the .NETStandard references being pulled in through the EventFlow Packages. So somehow the mixture of .NET 4.6.1 full Framework and .NETStandard causes this issue.
Any clue?
Thanks and regards,
OliverB
The text was updated successfully, but these errors were encountered: