I am working on .NET framework 4.6 Web API application. My app is working on my machine and I was able to build it in my local but when I push it to our Azure Dev OPS CI, I got this build error.
Error CS0433: The type 'ZipArchive' exists in both 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
: Error CS0433: The type 'ZipArchiveMode' exists in both 'System.IO.Compression, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Process 'msbuild.exe' exited with code '1'.
please help,
I am getting following error when I am trying to access API endpoint:
Compiler Error Message: CS0433: The type 'MediaTypeHeaderValue' exists in both 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Net.Http, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Getting the following error when attempting to build my solution. I'm fairly certain I've done it on this machine before but it's been many months. I'm not sure what might have changed in the meantime.
Assembly uses 'Microsoft.AnalysisServices.AdomdClient, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' which has a higher version than referenced assembly 'Microsoft.AnalysisServices.AdomdClient' with identity 'Microsoft.AnalysisServices.AdomdClient, Version=8.0.700.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
I have attempted to remove every mention of 8.0.700.0 from my computer via the SSDT (un)installer and manual deletion of files and registry entries and gacutil. The project is configured to use 10.0, but I cannot figure out how it even knows that a 8.0.700.0 version exists in the first place.
As far as I know, nothing remains in the registry, or the GAC, or the assemblies folders for version 8.0.700.0.
Any idea what is going on here?
Currently in the GAC
$ gacutil /l | grep Microsoft.AnalysisServices.AdomdClient,
Microsoft.AnalysisServices.AdomdClient, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.AnalysisServices.AdomdClient, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.AnalysisServices.AdomdClient, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
Microsoft.AnalysisServices.AdomdClient, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL
I am using VS2015 .Trying to use System.Net.Http.Formatting gives me an error saying:
Severity Code Description Project File Line
Error CS0433 The type 'MultipartMemoryStreamProvider' exists in both 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' aaAPIs C:\Working\Angular\aa\Controllers\Product\ImagesController.cs 22
How can I solve this?
I have preserved a NuGet package of PostSharp.Toolkit.Threading, version 2.1.1.12, because I can't upgrade to version 3.x. Any project compiles fine, as long as I stay on .Net 4 or 4.5, but as soon as I change to 4.5.1 or 4.5.2, I get this error:
Error 3 error: Unhandled exception (2.1.7.35, 32 bit, CLR 2.0, Release): Cannot load assembly T:\WindowsFormsApplication4\packages\PostSharp.Toolkit.Threading.2.1.1.12\tools\PostSharp.Toolkit.Threading.Weaver.dll.
============ PostSharp Assembly Loading Log ===================
LOG: NativeDotNetPlatform.LoadAssemblyFromFile: T:\WindowsFormsApplication4\packages\PostSharp.Toolkit.Threading.2.1.1.12\tools\PostSharp.Toolkit.Threading.Weaver.dll.
LOG: Assembly identity returned by the host: postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil.
LOG: Assembly 'postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil' is not yet loaded in the AppDomain.
LOG: Invoking Assembly.Load({postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil})
LOG: (ClrHost) ProvideAssembly: "postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil".
LOG: Finding the assembly with binding identity 'postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil'.
LOG: Location found from cache: 'T:\WindowsFormsApplication4\packages\PostSharp.Toolkit.Threading.2.1.1.12\tools\PostSharp.Toolkit.Threading.Weaver.dll'.
LOG: (ClrHost) ProvideAssembly: "postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil": assembly found in search path.
LOG: (ClrHost) ProvideAssembly: "postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil": located in "T:\WindowsFormsApplication4\packages\PostSharp.Toolkit.Threading.2.1.1.12\tools\PostSharp.Toolkit.Threading.Weaver.dll".
LOG: (ClrHost) ProvideAssembly: "postsharp.toolkit.threading.weaver, version=0.0.0.0, culture=neutral, publickeytoken=null, processorarchitecture=msil": returned successfully.
LOG: AssemblyLoadException: Could not load file or assembly 'postsharp.toolkit.threading.weaver, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
LOG: Loaded: 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' from 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll'.
LOG: Loaded: 'PostSharp.Hosting, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.Hosting.dll'.
LOG: Loaded: 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' from 'C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll'.
LOG: Loaded: 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' from 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'.
LOG: Loaded: 'PostSharp.Sdk, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.Sdk.dll'.
LOG: Loaded: 'PostSharp.Settings, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.Settings.dll'.
LOG: Loaded: 'PostSharp, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.dll'.
LOG: Loaded: 'System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' from 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'.
LOG: Loaded: 'System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' from 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'.
LOG: Loaded: 'PostSharp.Pipe, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.Pipe.dll'.
LOG: Loaded: 'PostSharp.Sdk.XmlSerializers, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7' from 'T:\WindowsFormsApplication4\packages\PostSharp.2.1.7.35\tools\Release\PostSharp.Sdk.XmlSerializers.dll'.
=============================================================== See below for details. T:\WindowsFormsApplication4\WindowsFormsApplication4\POSTSHARP WindowsFormsApplication4
I can't figure out why this is happeneing. Any P# gurus out there?
The log shows that PostSharp hosting CLR version is 2.0. While loading the threading weaver assembly, CLR also attempts to load some dependency that requires CLR 4.0. This is when you get an exception.
PostSharp 2.x can recognize target framework 4.5 and automatically choose hosting CLR 4.0, however the newer framework version 4.5.1 is not recognized and CLR 2.0 is used by default.
You can override the hosting CLR by setting the MSBuild property PostSharpTargetFrameworkVersion to 4.0.