Could not load file or assembly after deploy to server

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hello!

Everything is working fine on our localhost machines; however, when we deploy to our dev server (using Publish in Visual Studio), we get the error `Could not load file or assembly Assembly.Name, Version-2.0.0.0 or one of its dependencies. The located assembly's manifest definition does not match the assembly reference` on a ton of DLLs.  

If I look in the packages folder at the root of my local nopCommerce solution, I see that all of the DLLs in question have multiple versions: 2.0.0 and 2.1.1.  The error message on the server is telling me that it can't find the 2.0.0 version, so I have been copying the 2.0.0 versions of these DLLs over to our dev server.  Every time I copy one, I seem to get past that error to see the same error with another DLL.  There are 273 DLLs in the website, so I really don't want to go about replacing every one until I get the site to load; also, I'm pretty sure that is not the proper or safe way to get beyond this problem.  If I look in the Solution Explorer in Visual Studio and search for one of these DLLs, I see that they are all in fact mentioning the 2.0.0 version.  I think this is correct, but somehow the wrong versions are getting moved up to the server.  

How can I determine what is wrong and get beyond this without just replacing up to 273 DLLs?

Thanks in advance.  I realize that this may be a more general ASP.Net Core question that a specific nopCommerce question, but it's currently a huge barrier to us getting our new site out in the dev environment for UAT.

Jeremy
5 years ago
Just replace all 273 DLLs in one go, isn't that the simplest solution? :)


5 years ago
It also seems so scary!
5 years ago
I think I wasn't totally clear.  Let's take Microsoft.Net.Http.Headers, for example.  In my publish output folder on my localhost, this is file version 2.0.1.17303, product version 2.0.1-rtm-125.  On the dev server, it's the same version.  In my nopCommerce/packages folder on my localhost, I have two folders: Microsoft.Net.Http.Headers.2.0.0 and Microsoft.Net.Http.Headers.2.1.1.  In the 2.0.0 folder, I see a Microsoft.Net.Http.Headers.dll that says it is file version 2.0.0.17205, product version 2.0.0-rtm-26452.  If I copy this file to the server (overwriting the one on the server now), I can get past that error, but a new error takes its place (right now, it's stuck on Microsoft.AspNetCore.Razor.Language).  So, if I want to move every DLL at once, I would need to drill into each of the 273 folders.  I'm pretty confident that I would miss something or screw something up doing it that way.

Thanks!

Jeremy
5 years ago
I went about ten more DLLs down the road and things started working again.  Is there any way to avoid this sort of confusion with the wrong version of an assembly getting out to the server?

Thanks!

Jeremy
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.