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 on
Developer Community 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.
We have a iOS app that references another library.
Let's say I have an iOS executable Exec1 that references a library Library1.
For some unknown reason, I get "The "MangleLibraryResources" task failed unexpectedly." (cf details after).
It complains that it can't find to resolve my assembly Library1 (but it DOES exist in the bin/iphone folder).
I noticed that it is related to Content build action since if I change all Content to None in Exec1, it works fine.
Not sure how Content could affect the Cecil AssemblyResolver since it seems quite unrelated...
error MSB4018: The "MangleLibraryResources" task failed unexpectedly.
error MSB4018: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Library1, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null'
error MSB4018: at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
error MSB4018: at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
error MSB4018: at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
error MSB4018: at Mono.Cecil.TypeReference.Resolve()
error MSB4018: at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
error MSB4018: at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence, ParameterDefinition parameter, ParamTable table)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
error MSB4018: at Mono.Cecil.MetadataBuilder.AddTypeDefs()
error MSB4018: at Mono.Cecil.MetadataBuilder.BuildTypes()
error MSB4018: at Mono.Cecil.MetadataBuilder.BuildModule()
error MSB4018: at Mono.Cecil.ModuleWriter.<BuildMetadata>b__0(MetadataBuilder builder, MetadataReader _)
error MSB4018: at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
error MSB4018: at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
error MSB4018: at Mono.Cecil.ModuleWriter.WriteModuleTo(ModuleDefinition module, Stream stream, WriterParameters parameters)
error MSB4018: at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
error MSB4018: at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
error MSB4018: at Xamarin.MonoTouch.Build.Tasks.MangleLibraryResources.EmbedResourcesOnAssembly(String assemblyPath, ITaskItem resources, String projectDir, String prefixes)
error MSB4018: at Xamarin.MonoTouch.Build.Tasks.MangleLibraryResources.Execute()
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
Sorry, my bad, the files that I need to switch from Content to None are in Library1.
As per comment 1 closing this issue.
No, I mean the issue is still valid, it was to correct my comment.
Just to clarify:
I meant that the files I had to changes from Content to None were in Library1, not Exec1 (but problem might still apply to both anyway, not sure).
This issue is still present (and very hard to diagnostic).
Sorry for the confusion.
As we've added several improvements to our build system and deploying/debugging
mechanism since the bug was reported, I'm resolving it tentatively as Fixed.
That said, if you're still facing this issue with current bits, please feel
free to reopen the bug.