Mu csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net461;netstandard2.0;net5.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.IO.Compression" />
</ItemGroup>
</Project>
it have three framework .net4.6.1 and netstandard2 and .net 5
and system show below message
warning MSB3243: No way to resolve conflict between "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression". Choosing "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
I'm confuse about it, their version publickeytoken are same.
full code
Severity Code Description Project File Line Suppression State
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "System.IO.Compression". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. MiniExcelLibs C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "System.IO.Compression". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. MiniExcelLibs C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182
Warning MSB3243 No way to resolve conflict between "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression". Choosing "System.IO.Compression, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. MiniExcelLibs C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182
Warning MSB3243 No way to resolve conflict between "System.IO.Compression, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "System.IO.Compression". Choosing "System.IO.Compression, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily. MiniExcelLibs C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182
How can I deal the waring or set configution to ignore it, thanks.
update :
I've tried set version for each framework, but not work
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup Condition=" '$(TargetFramework)' == 'net461'">
<Reference Include="System.IO.Compression" Version="4.1.3.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
<Reference Include="System.IO.Compression" Version="4.1.3.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net5.0'">
<Reference Include="System.IO.Compression" Version="5.0.0.0" />
</ItemGroup>
</Project>