So we have a project (target .NET framework 4.6.2
) that uses System.Diagnostics.Tracing
, which is a dependency from a chain of other packages.
User 1 installed it via Nuget and shared the code to others. However, now we are in a mess that eventually results in the error of The located assembly's manifest definition does not match the assembly reference (Exception from HRESULT: 0x80131040
for at least one of us.
And trying to fix it, we realized that the reference to System.Diagnostics.Tracing
is different for each of us.
User 1: It points to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.2\Facades\System.Diagnostics.Tracing.dll
User 2: It points to C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Diagnostics.Tracing.dll
User 3: The only one that it actually points to the installed Nuget package C:\Users\User3\Documents\Project\Test\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll
And for some reason User 3 is the one who can't run the project. User 1 and User 2 are fine.
And the .csproj
file does have this specifically.
<Reference Include="System.Diagnostics.Tracing">
<HintPath>..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll</HintPath>
<Private>True</Private>
</Reference>
We are out of ideas why this would happen, and how to fix it. Nuget is supposed to be a good way to deal with dependencies, and somehow it is very messy in this situation.
Anyone has experience on dealing with this?