I updated a single 3rd party assembly, and I am getting an error:
Could not load file or assembly 'Some.Assembly, Version=1.0.3.15922,
Culture=neutral, PublicKeyToken=62a6874124340d6e' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)
When I updated this assembly, the version is now 1.0.3.23655.
Is it because of a strong named assembly that other dependent assemblies are complaining about?
It's the version. You either need to rebuild (assuming that the dependent assemblies are yours), or if you are positive that the new version is compatible, you can configure .net to use the newer assembly. Details here: http://msdn.microsoft.com/en-us/library/7wd6ex19(VS.71).aspx
Yes this is what it is complaining about.
Please look here and here to guide you in resolving your versioning issue. Is your assembly signed using strongname?
Hope this helps.
Related
I need to debug SharpDX to understand what is going on in my app - my project uses it via a reference from another NuGet package. Since the first package is referencing it with a PublicKeyToken even though I have built the same version of SharpDX and switched the SharpDX reference from NuGet to the local assemblies, my project wont build since it seems that it wants a signed version of SharpDX. The error message I am getting during the build is:
Error CS0012: The type 'TextLayout' is defined in an assembly that is not referenced. You must add a reference to assembly 'SharpDX.Direct2D1, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'.
I have built this assembly with the same version (3.1.1.0) but I have not sign it (and I assume I cannot do this since the repo does not contain the key file).
Is there any way around this how I can make the NuGet package that references SharpDX load the locally built assemblies?
I found this and tried to turn off the strong name validation for that public key token, leave the references in tact (the project still references the SharpDX NuGet package) and replace the binaries and then run the application. It still fails at runtime with:
Message:Could not load file or assembly 'SharpDX.Direct2D1, Version=3.1.1.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
But this did not match the explicit error about the strong name given in the link. To verify the version I opened the build assembly with ildasm and the version is in tact:
I've added Microsoft.Bcl.Build/Microsoft.Bcl and Microsoft.Bcl.Async to some projects in my solution where I want to use async/await.
Everything works fine on my machine with .Net4.5 installed. However, when I start the application on a machine with only .Net4 installed, at some point, the application crashes with the following Exception:
Could not load file or assembly 'System.Threading.Tasks, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Looking at the StackTrace, the exception seems to be generated in a third party library that we reference.
When I analyze the Microsoft.Threading.Tasks.dll provided by Microsoft.Bcl.Async, I see that it does reference System.Threading.Tasks Version 1.5.11.0, but version 2.6.10.0 is included in Microsoft.Bcl.
Am I doing something wrong?
I found the solution! It was actually very simple. I just had to copy and paste the binding redirects that nuget adds in the app.config files into the *.exe.config file. Then it just magically works. Easy fix.
I am now dealing with a existing solution in VS2012.
Now I can execute it in debug mode but cannot trigger some of the function with the error
"Exceptions: System.Exception: Could not load file or assembly
'Interop.Score, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=5ce8a8a190705d24' or one of its dependencies. The
located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)"
After finding some of the suggestion, some of that suggest me to compile the solution in 32-bit (x86).
However, when I tried to rebuild with the target platform x86, another type of error occur and I even cannot run in debug mode, the error:
Referenced assembly 'GenCode128.dll' is not a valid assembly C#
P.S. GenCode128.dll is one of the error .dll, there is at least 2 of this kind of error.
I cannot search any successful way to solve this problem, appreciate for any help.
You can use a decompiler such as DotPeek (https://www.jetbrains.com/decompiler) to look inside your DLL and see if it is a valid .NET DLL -- and which version of .NET it is. It could be an x64-compiled assembly; in that case you cannot use it on a 32-bit system or from a 32-bit-compiled .NET assembly.
You can try installing it from NuGet.
I've created a NuGet package for GenCode128.dll here: https://www.nuget.org/packages/GenCode128/
Also the source can be found in GitHub: https://github.com/SourceCodeBackup/GenCode128
I have an ASP.NET MVC 4 project that I need to update to use Lucene 3.0. I needed to manually set the framework to use .NET Framework 4.5 because I'm using the latest Windows Azure libraries which require this version. Everything is working, except when I add a new data model with the Entity Framework. I can successfully add a new data model with the Entity Framework. However, when I attempt to execute a basic stored procedure (it only executes a query), I get a runtime exception. The exception is:
System.Reflection.ReflectionTypeLoadException
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
When I look at the LoaderExceptions property, I see the following:
[0] {"Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"} System.Exception {System.IO.FileLoadException}
[1] {"Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"} System.Exception {System.IO.FileLoadException}
The oddity is, I can't find a single reference to Lucene.Net version 2.9.4.1 anywhere. I do reference the 3.0.3.0 version of Lucene.Net in my app. Can someone tell me where the 2.9.4.1 version of the file would be referenced? I've looked in the following locations:
MyProject.csproj
Web.config
Global.asax.cs
packages.config
How do I fix this? I've been beating my head on this for 2 days. Its so bizarre. Thank you so much for any help that can be provided.
I know not exactly an answer to the question, but if it truely does stump you (and you're lucky enough that the two versions are compatibly) you can redirect any requests for 2.9.4.1 to the version you do have by adding a binding redirect to your config file.
see : http://msdn.microsoft.com/en-us/library/433ysdt1.aspx
I have got this error when using Enterprise Library 3.1 May 2007 version. We are developing a product and have a common lib directory beneath the Subversion Trunk directory
<>\Trunk\Lib\ into which we put all the third party DLLs. Inside this we have Microsoft\EnterpriseLibrary\v3.1 in which we have copied all the dlls from \Program Files\Microsoft Enterprise Library May2007\bin. Everything was working properly until one of the developers installed the source code on this machine. There were some dlls copied at the end of the source code installation and once that was done, he is not able to run the project anymore. He always gets this error
'Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'
What is the problem here? I thought that when the source code was installed it was just supposed to build everything and copy in the bin directory within the source code parent directory. Also we have copied the Dlls from Microsoft Enterprise Library May 2007\bin directory into our product development directory and references into our project with a copylocal flag set to true.
Can anyone help me out here
RK
I used to get that when I developed against the signed version of the dll and deployed where only the unsigned version was available.
Also, fuslogvw.exe. EVERY. TIME.
I assume the error lies in the developer having compiled the code against the unsigned source code compilation he has.
Make sure he adds the reference to the signed DLLs before compiling his code.
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null
should be something like:
Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=fa03fef243232
maybe you should check the Assembly- and FileVersion of the dll. if they do not match this exception can occur.
Read here to get started with assembly loading debugging.
In short you need to check the Fusion log for more information.
For a "The located assembly's manifest
definition with name [yourAssembly]
does not match the assembly reference"
message (for hresult
FUSION_E_REF_DEF_MISMATCH,
0x80131040): The Fusion log will say
which part of the assembly reference
failed to match what was found. It
will be the assembly name, culture,
public key (or token) or version (if
the found assembly was
strongly-named).