-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I hope this is the correct place for this bug, if not, please point me as to where to file this.
I've hit a really strange place in the SDK with regards to NuGet packages and .NET Standard and type forwarders and all the magic going on there.
I have a project that uses Microsoft.Build + Microsoft.Build.Framework + Microsoft.Build.Utilities.Core from NuGet.
This same project also deals with Zip files, so it uses System.IO.Compression and System.IO.Compression.FileSystem.
Microsoft.Build v15.1 does not use System.IO.Compression and so all works fine.
Microsoft.Build v15.3 and above do use System.IO.Compression. They refer to version 4.1.2.0. The version included in the .NET Framework is version 4.0.0.0.
If I reference Microsoft.Build from NuGet and System.IO.Compression from the SDK/GAC, I get build warnings/errors. This occurs with both the old ("Classic Desktop") SDK as well as the new SDK.
Old SDK (with SDK/GAC reference to System.IO.Compression[.FileSystem]):
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(1988,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
New SDK (targetting net461):
The type 'ZipArchive' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO.Compression, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
If I reference Microsoft.Build from NuGet and System.IO.Compression from NuGet, it compiles with no warnings or errors, however I get a runtime/JIT exception.
`Unhandled Exception: System.MissingMethodException: Method not found: 'System.IO.Compression.ZipArchive System.IO.Compression.ZipFile.Open(System.String, System.IO.Compression.ZipArchiveMode)'.
Is there any way to reference both Microsoft.Build >= 15.3 and System.IO.Compression.ZipFile both from the same project?