Bug 48729 - Framework assemblies can overwrite app-provided (e.g. NuGet) assemblies of the same name in the app bundle
Summary: Framework assemblies can overwrite app-provided (e.g. NuGet) assemblies of th...
Status: RESOLVED INVALID
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: mmp ()
Version: 2.10.0 (C8)
Hardware: PC Mac OS
: High normal
Target Milestone: (C10)
Assignee: Bugzilla
URL:
Depends on: 48743
Blocks:
  Show dependency tree
 
Reported: 2016-12-02 16:39 UTC by Aaron Bockover [MSFT]
Modified: 2017-02-07 17:28 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Aaron Bockover [MSFT] 2016-12-02 16:39:59 UTC
There is a bug in the Mono implementation of System.IO.Compression.ZipArchive.CreateEntry where it ignores the CompressionLevel argument altogether. It does not translate "NoCompression" into "Store", which means invalid entries get created for zero-byte streams.

Anyway, because of this, I wanted to use the corefx version, available on NuGet, which is entirely managed and does not in turn depend on ICSharpCode.

However, either via the MSBuild targets for mmp, the Xamarin.Mac FX version is always ultimately copied into the .app bundle, effectively clobbering the NuGet version.

This is a "full framework" (desktop) app:

84c89d23d07d5050e7e39e0a7b01ce0c  bin/Debug/NuGetZip.app/Contents/MonoBundle/System.IO.Compression.dll
84c89d23d07d5050e7e39e0a7b01ce0c  /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/4.5/System.IO.Compression.dll
9661714578a06ecb815369db1d364fe9  packages/System.IO.Compression.4.3.0/lib/net46/System.IO.Compression.dll
Comment 1 Aaron Bockover [MSFT] 2016-12-02 16:41:16 UTC
I just confirmed this is also an issue with the supported mobile profile:

ec8d5dfae79110d06f4eeb7b056ae900
bin/Debug/NuGetZip.app/Contents/MonoBundle/System.IO.Compression.dll

ec8d5dfae79110d06f4eeb7b056ae900
/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.IO.Compression.dll

9661714578a06ecb815369db1d364fe9
packages/System.IO.Compression.4.3.0/lib/net46/System.IO.Compression.dll
Comment 2 Aaron Bockover [MSFT] 2016-12-02 18:11:18 UTC
This may be at least partially related to bug #48743.

However, if I manually edit the csproj to give System.IO.Compression a correct hint path, we can still see that mmp is given the target framework path for the assembly, and not the NuGet path.
Comment 3 Chris Hamons 2016-12-02 18:15:17 UTC
I'm blocking this bug on XS's bug (since mmp isn't even getting the right path to mess up).
Comment 4 Chris Hamons 2016-12-05 22:01:31 UTC
@Abock - Since https://bugzilla.xamarin.com/show_bug.cgi?id=48743 got close answered, is this still an issue?
Comment 5 Manuel de la Peña [MSFT] 2017-01-03 09:56:57 UTC
@Abock any comments about this? Should we close the bug?
Comment 6 Aaron Bockover [MSFT] 2017-02-07 17:28:54 UTC
I think this can be closed. The System.IO.Compression NuGet targets 4.6. If 4.5 is the target, the hint path is not set by XS, so mmp would have no way to know how to resolve the NuGet version.