Xamarin.iOS – The root assembly conflicts with another assembly

This error got me for a while yesterday and this morning.

It simply means what it states, but being new to Xamarin Forms mobile development, in multiple platforms (iOS, Android and Windows), I wasn’t exactly sure what it meant or how to fix it. 

The Error:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets (794,3): error MT0023: The root assembly /Users/ladmin/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/51923b53538fc7b3f186a0fbc2a615a5/bin/iPhoneSimulator/Debug/MyApp.exe conflicts with another assembly (/Users/ladmin/Library/Caches/Xamarin/mtbs/builds/MyApp.iOS/51923b53538fc7b3f186a0fbc2a615a5/bin/iPhoneSimulator/Debug/MyApp.dll).

I simply didn’t understand why or how it was trying to build an EXE and DLL of the same name.  It is correct, you cant have two binary executable files (exe and dll) of the same name.  I thought I had 3 projects (iOS, Android and Windows in one solution… but actually I had 4 projects, the 4th being all the shared code between the 3 OS projects.  I had also renamed the iOS Application assembly name from MyApp.iOS to just MyApp.  The iOS project then tries to generate a MyApp.exe and the shared MyApp project tries to generate a MyApp.dll. 

So, I simply needed to change the assembly name of the shared code project or change the assembly name of the iOS project so they no longer matched.

Remember… simply turn off the code processor in your head… read and understand the error message… sometimes it actually tells you the real problem.  But… maybe MS VisualStudio could at the solution level examine the projects in the solution and notice that two projects in the solution have the same assembly name and give an error message like:

ERROR:  Assembly name conflict between project One and project Two.
Suggested resolution:  Change the assembly name for one of these projects.

One thought on “Xamarin.iOS – The root assembly conflicts with another assembly

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.