Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 59451 on
GitHub or Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 24727 [details]
msbuild/mono has support for replacing denied assemblies with corresponding ones from Mono.
In a net461 project, msbuild fails to find a replacement for `System.Text.Encoding.CodePages`, giving an error like:
(FilterDeniedAssemblyReferences target) ->
/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/xbuild/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.Common.Mono.After.targets(25,9): warning MSB3912: INTERNAL WARNING: Could not find the replacement assembly (System.Text.Encoding.CodePages.dll) for the Windows specific reference /Users/ankit/Projects/TestConsole/packages/System.Text.Encoding.CodePages.4.3.0/lib/net46/System.Text.Encoding.CodePages.dll. Please file a bug report at https://bugzilla.xamarin.com .
To reproduce with the attached test project:
$ nuget restore
$ msbuild /p:FilterDeniedAssemblies=true
Note that you have to explicitly enable this with `/p:FilterDeniedAssemblies=true`, as it is normally not an issue for a regular .net project. And that is because the mono runtime denies the assembly load but then continues to search for another assembly to satisfy that. But it would be an issue if were to try to bundle the app + dependencies in some form.
The reason it fails is that the search paths used by `FilterDeniedAssemblies` in this case are:
And the assembly exists only in /Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/4.5/Facades .
This is related to https://bugzilla.xamarin.com/show_bug.cgi?id=56682 .
This looks like some bad logic in the Task itself. I can see the assembly to be listed correctly at https://github.com/mono/mono/blob/adbf98b977572b6915bb286edb1abb5c2afd0d0e/mcs/tools/xbuild/data/deniedAssembliesList.txt#L14
Yeah and it is correctly identifying the assembly as a denied one. But it cannot find a replacement. See details in the bug description.