I am getting the following error building my C# project.
Assembly "name_of_assembly" uses 'Microsoft.Synchronization,
Version=2.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
which has a higher version than referenced assembly
'Microsoft.Synchronization, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91'
I have made sure all my class libraries are targeting the same version of .NET framework which typically seems to be the problem.
I examined the installed programs and found I had version 1.0 and 2.1 of Microsoft Sync Framework installed. I uninstalled version 1 components. That fixed the problem.
Now my code builds fine.
There are several components for each version in installed programs. I uninstalled two of v1.0 but still have its Runtime component but code already builds fine.
If you only have v1 installed, uninstall it and install the correct version, version 2.1 is here.
Related
I have a DLL compiled from a project of type "Class Library" which has a target framework of netcoreapp3.1 (EDIT: now netstandard2.0).
I then reference this DLL in another project, a Windows Forms application, which targets .NET Framework 4.7.2 (EDIT: now 4.8).
When trying to compile the Windows Forms application, I get the following error:
Error CS1705: Assembly 'BC' with identity 'BC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I would like to update System.Runtime on the WinForms project to use version 4.2.2.0 (which is apparently required by my DLL), however, I found no way to do so - there are no NuGet packages installed and the references section in Visual Studio doesn't seem to include System.Runtime directly:
How do I update System.Runtime and resolve the error?
Try any of the following:
Upgrade your WinForms project to .NET 4.8, because there have been a lot of compatibility fixes in that release. .NET 4.8 still has issues when interfacing with .NET Core libs, but many problems will just be gone.
Or try changing your library to .netstandard2.0. Then it should always be compatbile to Net Framework.
For best compatiblity, try doing both: Setting the library to .netstandard2.0 and change the WinForms app to .NET 4.8.
I have asp.net core project which runs on Asp.Net Core V2.1.0 which has signal r integrated. I have downloaded a sample project from aspnetbrolerplate. When I try to run the application it gives me following error.
System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Memory, Version=4.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.'
Can anyone please suggest me possible solution for this issue.
I found installing the System.Memory NuGet package resolves the issue.
It is confusing that earliest version is 4.5.1, but if you install it, you will find the assembly versioned a System.Memory, Version=4.1.0.0.
For my .NET Framework project I installed NuGet version 4.5.4 which contains System.Memory, Version=4.0.1.1 assembly.
I found that this is a known issue for UWP. Update to Asp.Net Core 2.1.1 and Microsoft.AspNetCore.SignalR.Client NuGet Package to at least 1.0.1, which has a fix for this UWP issue.
Maybe it also fixes your issue.
I'm currently developing an app for a Microsoft Hololens.
To use the database libaries of the company I already ported the old .NET Framework libaries into .NET Core 2.0.
I used the Portability Check Tool issued by Microsoft to be sure that I was on the right track.
Apparently my idea worked that's why I included a new UWP App to run on my Hololens.
When I tried using my libary connection commands I encountered the following issue:
Assembly 'xy' with identity
'xy, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' uses 'System.Data.Common, Version=4.2.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher
version than referenced assembly 'System.Data.Common' with identity
'System.Data.Common, Version=4.1.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'
It seems that my newly ported libaries use a higher version of System.Data.Common than my Universal Windows project.
I am currently at a loss on how to have an equal version in both projects.
I already tried a bunch of packages from Nuget and also downgrading my libraries didn't help.
I have a netstandard20 project that references a .Net 4.6 Project, all compiles and runs except where I call any functionality in the .Net 4.6 project, I get the following error.
FileNotFoundException: Could not load file or assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
In VS 2017, in the project explorer under Dependancies / SDK / Microsoft.NETCore.App I can see System.Data.dll and System.Data.Common.dll but no reference to System.Data.Linq.dll, I am assuming this is my problem and it has not been pulled in.
How do I get my project to include System.Data.Linq.dll?
If I include C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Data.Linq.dll I get the following error
BadImageFormatException: Could not load file or assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)
I was able to solve my need to use System.Data.Linq in a .NET Standard 2.0 library by using the Mindbox.Data.Linq NuGet package.
After installing it you should be able to use the System.Data.Linq namespace just like you could when writing for .NET Framework!
System.Data.Linq is not part of .NET Standard 2.0 and .NET Core 2.0 and therefore cannot be used on that platform.
Even tough you have been able add a reference to a .NET 4.6 project via the compatibility shims, it fails at runtime because of a feature that is not available on the target runtime
I am using 7.5.0.0 amqmdnet.dll and building my .net app using MQ.NET classes, however after deployment, if the target machine has 7.1.0.0 MQ client installed, the app throws can't find assembly
7.5.0.0 dll information, is IBM's MQ client version not backward client compatible?
System.IO.FileNotFoundException: Could not load file or assembly
'amqmdnet, Version=7.5.0.0, Culture=neutral,
or one of its dependencies. The
system cannot find the file specified.
I can't find any information related to this at the official page.
IBM 7.5 link
Does that need to be always the build version in the target computer? I assume if i use 7.1 dll, it will work with 7.1 greater versions too. When i referenced 7.1.0.0, i get this in the project file.
<Reference Include="amqmdnet, Version=7.5.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\IBM\7.1.0.0\amqmdnet.dll</HintPath>
</Reference>
Why is it having 7.5.0.0? any idea (although the version i have referenced is 7.1.0.0)?
The backward compatibility "issue" is not just limited to MQ, it's with all .NET assemblies. Compiling an application with one version of a .NET assembly and running it with a lower version of that .NET assembly is not supported, not just MQ but every .NET assembly. You have to use the same version of the assembly that the application was built with. If you have higher version of that assembly then you would require policy files to redirect the .NET CLR to load the higher version of that .NET assembly.