3

I have a very weird situation I hope someone can help with!

I have a normal ASP.NET MVC website. I've set up "Deployment Options" to push to a domain on every Develop commit. However, this has started giving the dependency error:

Could not load file or assembly 'System.Net.Http' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Now, I thought this was some caching since solution worked locally. So I have been publishing the app inside Visual Studio a couple of times (with option of deleting all remote files), and then the solution works.

However, after doing this, and I go back to a normal commit with Deployment Options, I go back to the same error:

enter image description here

Lars Holdgaard
  • 9,496
  • 26
  • 102
  • 182

3 Answers3

2

From your description it seems like it has deployed successfully in past.

Have you upgraded project recently? If yes, look at this thread Strange issue with System.Net.Http 4.2.0.0 not found

Also, check if you are referencing DLL from NuGet and not GAC.

r2018
  • 505
  • 4
  • 14
0

First thing that comes to mind is that you added a new DLL in your solution that depends on another version of System.Net.Http assembly. If you know that you added a new DLL, check for its assembly dependency.

Another solution might be to manually specify the version of the assembly in code. And select SpecificVersion. (but I'm guessing it's the first thing that causes the issue).

  • But why would there be a difference on my deployment style? I know it happened after I upgraded my dependencies, but it doesn't change why it's super weird normal publishing works, while "Deployment options" in portal doesn't :-) – Lars Holdgaard Aug 01 '18 at 13:26
  • It might be a shot in the dark here, but maybe the publishing doesn't overwrite the existing assemblies. Other than that, I honestly have no idea. – Iustinian Andrioaie Aug 01 '18 at 13:29
  • But the publishing works, so I am pretty sure it overwrites. The challenge is Deployment Options.. :-) – Lars Holdgaard Aug 01 '18 at 15:28
0

I have came across similar issue once. There should be a mismatch of the versions between System.Net.Http package.

Try verifying the version of System.Net.Http for the entire solution and refer the same version in all the projects.

This happens if a package is referenced in a project and different version of the same package is referenced in another project. Here, this error occurs when there is a reference between these two projects.

Arunprabhu
  • 1,454
  • 9
  • 15