I found a problem within Entity Framework. I downloaded the code and fixed the issue, and finally compiled the assemblies.
Now i have been struggling for hours but I can't figure out HOW to use my assemblies in my project. I tried to overwrite the assembly in the packages folder but whenever I try to execute commands from the package manager I get errors like
"Unable to load file or assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one .... The assembly's manifest definition does not match the assembly reference. (Eccezione da HRESULT: 0x80131040)".
The same happens when running my project.
EDIT:
I tried also to find and replace any revelant (not all) occurrences of Microsoft PublicKeyToken in EntityFramework.dll, EntityFramework.PowerShell.dll and replace them in packages folder. Nothing. Tried to modify any references in .csproj, app.config. nothing.
How can I solve the problem and use my EntityFramework.dll both in project and Package Manager?
Thanks
Related
I am using both ExcelDataReader.Mapping - 2.2.2 and ExcelMapper - 5.2.429 nuget packages in a project. I know it seems redundant, however, one of these projects gives a little more flexibility that I need when reading excel files. It seems there is some conflict between namespaces and classes between these two projects. To fix that, I have ExcelDataReader.Mapping aliased as ExcelReader and ExcelMapper as ExcelWriter. This worked briefly, but now I am running into another issue.
I get the following message on build of the project: warning MSB3243: No way to resolve conflict between "ExcelMapper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=6c3f2bec99465df3" and "ExcelMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null". Choosing "ExcelMapper, Version=5.0.0.0, Culture=neutral, PublicKeyToken=6c3f2bec99465df3" arbitrarily.
Using the diagnostic build, I also see this error: Encountered conflict between 'Runtime:C:..\.nuget\packages\exceldatareader.mapping\2.2.2\lib\netstandard2.0\ExcelMapper.dll' and 'Runtime:C:..\.nuget\packages\excelmapper\5.2.429\lib\netstandard2.0\ExcelMapper.dll'. Choosing 'Runtime:C:..\.nuget\packages\excelmapper\5.2.429\lib\netstandard2.0\ExcelMapper.dll' because AssemblyVersion '5.0.0.0' is greater than '1.0.0.0'.
It appears they are using the same name for the .dll file, so it is causing some confusion as to which one it should use. Is there a way to change the .dll file name when installing packages? Or some way to register a full path when referencing the .dll file?
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 installed nuget Package LinqToExcel_64, which in turn added two refrences i.e.
1. LinqToExcel 1.7.1
2. log4net 1.2.11.0
I have already been using log4net(1.2.12.0) in my application.
My Code throws exception at below line of code:-
var dependants = from dependant in excel.Worksheet<ExcelDependant>()
select dependant;
Exception:-
Could not load file or assembly 'log4net, Version=1.2.11.0,
Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
Please Suggest how to resolve this problem.
Since you were already using the newer version of dil and package has the dependency on older version. That's why this exception is occurring. To resolve this, you can try to change the version of dependency dll in a configuration file located at:
Packages/"installed package name"/
I am having a very odd issue. I have done some research online in regards to this but none of the answers seem to help. This application was compiling and running properly a couple days ago, now it just errors out with the following error. Any suggestions on what I can do to resolve the issue? I really don't know where to go from here.
System.IO.FileLoadException: Could not load file or assembly
'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral,
PublicKeyToken=xxxxx' or one of its dependencies. The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040) File name: 'Newtonsoft.Json,
Version=4.0.5.0, Culture=neutral, PublicKeyToken=xxxxx'
My next steps would be to do the following:
Remove this in all projects using NuGet.
Go into the NuGet package repository and delete the files for Newtonsoft.Json. (they shouldn't still be there but if they are, it indicates a problem with NuGet and more troubleshooting there is required - in my experience, NuGet works about 30% of the time, and the rest of the time it is a pain in the ass).
Manually delete all the bin and obj folders in your project(s).
Re-add the Json library via NuGet.
If that doesn't work, please tell that as well.
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).