nopCommerce assembly dont find dll reference - c#

Im having some serous issues with a .dll not being found in Nop.Core.dll (i think)
the dll message the PluginManager.cs writes in the output in VS12 is as follows:
Could not load file or assembly 'Telerik.Web.Mvc, Version=2012.2.607.340, Culture=neutral, PublicKeyToken=29ac1a93ec063d92' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Ive added the right version of Telerik.Web.Mvc to the Nop.Core lib and built a new .dll but the issue still remains.
Ive also checked for cached .dlls in th GAC but nothing.
The issue occured after a restart of VS12 so there´s smt weird going on here. Ive tried disabling/enabeling auto update nuget on build (as i thought that it might be fetching some new dlls that might create a conflict) but nothing.
I do see that the Solution is running .net 4.5 but the Telerik.Web.Mvc.dll target framework is :
TargetFramework(".NETFramework,Version=v4.0", FrameworkDisplayName=".NET Framework 4")].
Can this cause some dll´s to not find Telerik.Web.Mvc.dll?
As im new to nopCommerce im kinda lost at this point. What am i doing wrong here? =)
/seb
Edit:

Make sure you have non-corrupted Telerik.Web.Mvc.dll in your bin folder (download one that comes with nopcommerce and overwrite it to be sure)
This issue may be caused by a plugin that has wrong reference. If you have any custom/old plugins try removing them or readd their reference and recompile.
Current version in 3.10 is 2013.2.611.340 while you have reference to 2012.2.607.340

Related

Assembly error after splitting solution into different projects

So, I had a ASP.NET MVC application, but everything was in 1 project. (ugh)
I decided to get a little closer to how it's done in the field, and split up into different projects in one solution.
After doing so, I spent some time adding all the needed assemblies to my new DataAccess project, adding it as a dependency to the other project etc. To have it not run and throw the error:
Could not load file or assembly 'MySql.Data.Entity.EF6, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
So clearly something was wrong with the MySql.Data.Entity.EF6 reference.
I spent hours searching for a solution, from changing the versions in my web.config to completely deinstall and reinstall the dependency, but no matter what I did, the error was here to stay.
If you've tried what I've tried (no matter the reference you're stuck with) It might be a good idea to check if it's been referenced in any other project in your solution.
If so, delete the reference from the other project (not the DataAccess project). And make sure you have the right versions in your web.config. You can check the versions via properties in VS.
When I did that, everything suddenly worked just fine.

What causes Microsoft.Practices.Unity assembly not to load?

I am running a project that had been running without issue for some time but recently started throwing an error stating,
"Could not load file or assembly 'Microsoft.Practices.Unity,
Version=2.1.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
or one of its dependencies. The system cannot find the file
specified."
I see that this assembly is for IoC/Dependency Injection support however I never explicitly added it to the solution; although I do see that it is in fact there.
When I check the version of the assembly it is showing the same version that is being referenced in the above error; so I cannot figure out why the file cannot be found by the project.
In effort of resolving the issue I've cleaned the solution, deleted my obj folder, rebuilt, removed and even reinstalled the assembly via nuget but the issue persists.
I've found somewhat similar issues reported here on SO but the proposed resolutions were either not applicable because it was not the same assembly reference as the one I'm having issue with OR it involved configuration of a XAML based application. This is ASP.NET.
The only other clue that I could find as to why I'm having the problem is that the targeted runtime framework of the assembly is v2.0.50727 and this application is .NET 4.5
Which would seem a reasonable explanation for the problem from my limited perspective except that the app was previously running without the problem.
I'd also mention that the assembly isn't explicitly being called from the block of code throwing the error; which is simply creating a web service client and calling a method.
long memberId = 1326728123;
ServiceClient sc = new ServiceClient("ServiceClientEndPoint");
var leadPackage = smc.GetLeadPackages(memberId);
So there could be other variables of this equation that may be attributing to the problem (e.g. Network blocking and etc)
I just wanted to make certain that I may not be missing something by running it past SO before wasting time going in the wrong direction for an answer.
Note that this could mean a number of things, including that one of the dependent assemblies of Microsoft.Practices.Unity could be loaded.
The first place searched is the GAC, if you are building and running on the same machine, this probably won't cause a problem because the runtime will also find the same library but if you are deploying, the project will sometimes bind to the GAC library whereas the production server might not have it installed and it will fail to run. CopyLocal=true should fix that but if you are deploying, you should check that the library is copied into the bin directory.
Secondly, you should open Microsoft.Practices.Unity.dll using reflector or ilspy.exe and see what other dependencies it has (other than the System.* libraries) since any other ones will need the same treatment as Microsoft.Practices.Unity i.e. adding to the project and copy local set to true.

Could not load file or assembly occurs after few days

I took over a project recently and it's using the NopCommerence package. When I load up the package in Visual Studio, it works fine, I have no troubles in VS, when I push live, everything is fine too, all works, but as soon as a few days sometimes even hours have passed, I get this error message:
Could not load file or assembly 'NPOI, Version=2.0.6.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
To solve this, I have to clean, rebuild and build the project and release a new set of files, my question is why does it randomly just fall over after so much time? I tried resetting the server, deleting temporary files but no luck.
Been doing this for weeks now and I can't find a solution.
This seems to be an issue where your .NET assembler is looking for an assembly of a specific version and instead of finding that, it is finding the assembly of that same thing, but of a different version.
It means that it wont work until both the files, i.e the actual file at the location and the reference in your configuration are same.
Check your config and then check on the actual file. If its of older or newer version, then replace it with the version that is actually required.
Here are a few links for your reference.
Assembly version mismatch
Resolving assembly conflicts
Hope this helps.

Could not load file or assembly NLog

Error: http://pbrd.co/1vTqOTb
I am getting an error in my XAML in my WPF project:
"Error 11 Could not load file or assembly 'NLog, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies.
The system cannot find the file specified. MainWindow.xaml 73 9 TestApp"
I have searched the entire solution and cant find any 'NLog'
I have tried to add the NLog dll to each of my projects in the solution but it makes no difference.
Any idea?
Turned out to be the NLog was .Net 4.0 and the project was .Net 4.5
I changed the project to 4.0 and the other dependent project to 4.0 and its working.
Thanks!
Whenever you reference another library, there's the chance they will need some other library. When you reference WPF, there are a lot of underlying libraries that get pulled up.
First, make sure that the DLLs you've referenced are set to "Copy Local = True" under their Properties. Also make sure they have the same PublicKeyToken as your error - if they're referenced by strong name (and most of .NET is) a slightly different version won't be read as the correct file.
The other thing you should consider is checking whether the DLL exists in your GAC, and manually installing it if it doesn't. This can often be the cause of such frustrating errors due to a misinstalled sdk (I once has the same issue with the Blend libraries)

Exception from HRESULT: 0x80131040

Warning 1 D:\MyPath\SomeAscx.cs: ASP.NET runtime error:
Could not load file or assembly 'HtmlAgilityPack,
Version=1.4.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a'
or one of its dependencies. The located assembly's manifest definition
does not match the assembly reference. (Exception from HRESULT: 0x80131040)
I have removed the reference and am not using it in code why would this still be an issue. I have tried cleaning solution, rebuilding, open and closing solution but still no success. Has anyone come across this issue before?
Even if you removed direct references, something else might still require that dll.
I'd suggest:
Recycle your IIS application pool (or run IISRESET from the command prompt to reset the entire web server)
turn on FusLog and check who is the real "offender"
This can happen if your project name conflicts with a nuget package you referenced. I wasted about 30 minutes before I realized what is going on.
I was doing a ReactJS tutorial, so I created a project called React, and then later I imported ReactJS.NET from nuget.
When I hit build, Visual Studio will build React.dll in bin folder since my project name is React, this dll overwrites the React.dll imported by nuget package ReactJS.NET
So my project blew up... and I wasted 30 minutes scratching my head.

Categories