We have a c# solution (framework 4.5.2), developed on a desktop, compiled on TFS server 2015. We added a new DLL project to it (framework 4.6.1), which uses the Microsoft Code Analysis package. The solution is being compiled with no problem on the desktop (VS 2017). We committed the changes to TFS, where it drops several compiler errors, e.g.:
The type 'ValueType' is defined in an assembly that is not referenced.
You must add a reference to assembly 'netstandard, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
The project contains several references according to word "netstandard":
<Reference Include="Microsoft.CodeAnalysis, Version=2.10.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.CodeAnalysis.Common.2.10.0\lib\netstandard1.3\Microsoft.CodeAnalysis.dll</HintPath>
</Reference>
<Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
When I added the the reference:
<Reference Include="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
the compile errors still reported. On the desktop the solution still compiles without warnings or errors. What to do next?
PS: Unfortunately, the framework versions are mixed in the solution. The 4.5.2 is preferred, but there was no chance to add MS Code Analysis package to a dll project with this version. :( Is the multiple framework versions the root cause of the problem?
Related
I've built a DLL of a NetStandard library which is used to access a database. The issue is that after referencing the DLL in my Xamarin Forms project, I cannot use any functions in my library because, the System.Runtime is outdated. Is there any way I can update the System.Runtime assembly in the project?
Go to the *.csproj file of the BucketList.Api and change the line:
<Reference Include="System.Runtime, Version=4.2.1.0, Culture=neutral, publicKeyToken=b04f5f711d50a3a">
to:
<Reference Include="System.Runtime, Version=4.1.2.0, Culture=neutral, publicKeyToken=b04f5f711d50a3a">
Recompile the BucketList.Api DLL and reference that.
Alternatively you may try this, which may or may not be legit:
<Reference Include="System.Runtime">
I'm getting an annoying MSB3277 warning when I build my project. I increased verbosity to "detailed" and I was able to get the following information from the log:
There was a conflict between "Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" and "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null".
"Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" was chosen because it was primary and "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" was not.
References which depend on "Pathoschild.Http.Client, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" [C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll].
C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll
Project file item includes which caused reference "C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll".
C:\Users\desau\.nuget\packages\pathoschild.http.fluentclient\3.0.0\lib\netstandard1.3\Pathoschild.Http.Client.dll
References which depend on "Pathoschild.Http.Client, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null" [].
C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll
Project file item includes which caused reference "C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll".
C:\Users\desau\.nuget\packages\stronggrid\0.30.0\lib\netstandard1.3\StrongGrid.dll
If I understand this log correctly, it's telling me that my project references Pathoschild.Http.Client version 3.0 and also version 3.1. I understand the reference to version 3.1 because my project references a nuget package called StrongGrid which itself references Pathoschild version 3.1
But I fail to understand where the reference to version 3.0 comes from.
I'm using Visual Studio 2017 and MSBuild 15 in case that's helpful information.
The reason for this issue is that the StrongGrid package is authored incorrectly.
The version 0.30 of StrongGrid is built against version 3.1.0 of Pathoschild.Http.FluentClient, but their .nuspec file used for creating the NuGet package still lists version 3.0.0 as dependency, so the consuming project will fetch an older version, creating a conflict that cannot be resolved.
To work around this problem, you can explicitly reference version 3.1.0 of Pathoschild.Http.FluentClient by adding a package reference to the csproj file to override the version.
I have an assembly that is registered in GAC. In 'Windows/assembly' folder I can see it and also see its PublicKeyToken 'aaaa'. I have a SSIS solution (I think no matter at all what is the type of solution).
SSIS package has many c# scripts, each of them has its own references. Some of them contains reference for my assembly. I see the same path to the assembly in properties for it in each script. BUT one of the scripts has another PublicKeyToken 'bbbb' (the others have 'aaaa'). And it breaks the whole solution. Build works good, but Run fails. How can I manage such situation?
Update: issue appeared after new version of assembly has been added to the GAC. the old one has been deleted.
I tryed to change reference for a copy of dll but the problem doesn't go away. Maybe is there any way to set PublicKeyToken? I've even tryed to change compiled file (but what if? =))
In .dtsx file (file for compiled package) it looks like:
for one script:
<Reference Include="MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bbbb, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\assembly.dll</HintPath>
</Reference>
for the others:
<Reference Include="MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaaa, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\assembly.dll</HintPath>
</Reference>
Hello i am working on windows universal platform app in this app
the error is occured when i Debug my windows universal project this error comes automatically so any one suggest me how resolve this error?
Error : - Cannot find type System.MarshalByRefObject in module CommonLanguageRuntimeLibrary
so suggest me how to resolve this error.
I have resolved this error while removing System.Drawing reference from Windows 10 Universal app project.
As on search Ctrl+F all keyword system.drawling not found in solution. because this reference only added to project and not in use. so checked in project file .csproj which find it. and remove this reference.
<ItemGroup>
<Reference Include="DocumentFormat.OpenXml">
<HintPath>..\JOIN8POS.Website\SharedDLL\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6\System.Drawing.dll</HintPath>
</Reference>
</ItemGroup>
and save .csproj file and reload all.
I have a reference to a custom assembly. Looking at the Assembly Properties I see
Path = C:\Windows\Microsoft.Net\assembly\GAC_32\Assembly.Namespace\v4.0_3.0.0.0__c199d42a01e99449\Assembly.Namespace.dll
When I look at the .cs project MSBuild I see
<Reference Include="Assembly.Namespace, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c199d42a01f89449, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Project DLLs\Folder Name\Assembly.Namespace.dll</HintPath>
</Reference>
The paths do not match. It also appears that the .NET runtime version doesn't match. When I build my project's in Visual Studio which uses Csc.exe it works. When I use FinalBuilder which uses MSBuild the build breaks.