How do I exclude a dependency of Microsoft.NETCore.App so I can replace it with a locally compiled (bugfix) version.
I carried out the normal procedure for replacing a package by making one with a higher version number, and tried to compile. The build tried to link against both and died at the compile step with CS0433 due to duplicate references.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\System.Threading.ThreadPool\System.Threading.ThreadPool.csproj"/>
<ProjectReference Update="..\System.Threading.ThreadPool\System.Threading.ThreadPool.csproj"/>
</ItemGroup>
</Project>
Compile error:
C:\Program FFiles\dotnet\sdk\2.1.604\Microsoft.Common.CurrentVersion.targets(2114,5): warning MSB3243: No way to resolve conflict between "System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null" and "System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyTokn=b03f5f7f11d50a3a". Choosing "System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null" arbitrarily. [path]
Program.cs(17,13): error CS0433: The type 'ThreadPool' exists in both 'System.Threading.ThreadPool, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' and 'System.Threading.ThreadPool, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null' [path]