Bug 57915 - VS2017: XF-iOS - Could not register the assembly Xamarin.Auth error MT4118
Summary: VS2017: XF-iOS - Could not register the assembly Xamarin.Auth error MT4118
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 10.99 (xcode9)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-07-03 19:03 UTC by Eric
Modified: 2017-10-18 13:28 UTC (History)
5 users (show)

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

VSTS BUILD LOGS verbose (166.32 KB, application/zip)
2017-07-04 02:40 UTC, Eric
Fresh VSTS Build Logs with system.debug=true (160.01 KB, application/x-zip-compressed)
2017-07-04 03:21 UTC, Eric
TruckerAppDotNetStandard Source Code (7.47 MB, application/x-zip-compressed)
2017-07-04 03:28 UTC, Eric
VS2017 verbose build / xamarin logs (566.46 KB, application/x-zip-compressed)
2017-07-04 03:29 UTC, Eric

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:

Description Eric 2017-07-03 19:03:37 UTC
I get the following error on compilation of my XF iOS project in VS2017 Enterprise. 

On my Mac I updated today to the latest "Beta" Channel updates.

Could not register the assembly 'Xamarin.Auth': error MT4118: Cannot register two managed types ('Xamarin.Controls.ProgressLabel, Xamarin.Auth' and 'Xamarin.Controls.ProgressLabel, Microsoft.Azure.Mobile.Client') with the same native name ('Xamarin_Controls_ProgressLabel').	trucker_rolsped.iOS.DEV-vs2017	C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets	

In VSTS Build I get:
2017-07-03T18:25:34.8307050Z "/Users/roland/myagent/myagent/myagent/_work/7/s/iOS-DEV/trucker_rolsped.iOS.DEV-vs2017.csproj" (default target) (3) ->
2017-07-03T18:25:34.8326910Z (_CompileToNative target) -> 
2017-07-03T18:25:34.8340980Z   MTOUCH : error MT4116: Could not register the assembly 'Xamarin.Auth': error MT4118: Cannot register two managed types ('Xamarin.Controls.ProgressLabel, Xamarin.Auth' and 'Xamarin.Controls.ProgressLabel, Microsoft.Azure.Mobile.Client') with the same native name ('Xamarin_Controls_ProgressLabel'). [/Users/roland/myagent/myagent/myagent/_work/7/s/iOS-DEV/trucker_rolsped.iOS.DEV-vs2017.csproj]

My Xamarin.Auth is v. 
The XF Solution has a .NET Standard (1.4) library.
Comment 1 Timothy Risi 2017-07-03 22:18:28 UTC
Please include your full build logs, crash reports (if any), test case (to reproduce) and all version information.

To get full build logs just set the log verbosity to diagnostic at the following locations:
- On Visual Studio for Mac: Preferences > Projects > Build
- On Visual Studio for Windows: Tools > Options > Projects and Solutions > Build and Run

On Visual Studio Windows you also want to add `-v -v -v -v` to the mtouch additional arguments by right-clicking the project in the solution explorer and selecting `Properties`.
Note: this is done automatically on Visual Studio for Mac when the log verbosity is set to diagnostic.

Easiest way to get exact version information:
- On Visual Studio for Mac: "Visual Studio" menu, "About Visual Studio" item, "Show Details" button.
- On Visual Studio for Windows: "Help menu", "About Microsoft Visual Studio" item.
Then copy/paste the version information (you can use the "Copy Information" button).
Comment 2 Eric 2017-07-04 02:40:19 UTC
Created attachment 23271 [details]

Please find attached the verbose build logs from VSTS.
Comment 3 Eric 2017-07-04 03:10:40 UTC
Version Information VS for Mac (VSTS uses my on-premises host, I don't build directly there because I develop in VS2017 on windows):

=== Visual Studio Community 2017 for Mac (Preview) ===

Version 7.1 Preview (7.1 build 1258)
Installation UUID: ce4cc8cd-d156-4944-bfee-a7a9be28d24f
	Mono (2017-04/478c04a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000196

=== NuGet ===


=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 1.1.0
SDK: /usr/local/share/dotnet/sdk/1.0.0-preview2-1-003177/Sdks
SDK Version: 1.0.0-preview2-1-003177
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.Android ===

Version: (Visual Studio Community)
Android SDK: /Users/roland/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.4 (API level 19)
		5.0 (API level 21)
		5.1 (API level 22)
		6.0 (API level 23)
		7.0 (API level 24)
		7.1 (API level 25)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 25
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Xamarin.Mac ===

Version: (Visual Studio Community)

=== Xamarin.iOS ===

Version: (Visual Studio Community)
Hash: 494fcbcf
Branch: d15-3
Build date: 2017-06-23 12:25:55-0400

=== Build Information ===

Release ID: 701001258
Git revision: b0333c272ef55159b4c209e71698203d2fb4acdd
Build date: 2017-06-26 17:47:47-04
Xamarin addins: 31cc58bd6e356d0e68b4dd5c9b51283f1506ce99
Build lane: monodevelop-lion-d15-3

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 4 Eric 2017-07-04 03:11:36 UTC
Version Information VS2017 on Windows:

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.14) Release
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Enterprise

Visual Basic 2017   00369-60000-00001-AA477
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA477
Microsoft Visual C# 2017

Visual F# 4.1   00369-60000-00001-AA477
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.2.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2017.1.2    Build 108.0.20170428.75743
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Hive Query Language Service   2.2.5000.0
Language service for Hive query

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.3.50417.1
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   4.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2017 ENU   15.0.26309
Microsoft Office Developer Tools for Visual Studio 2017 ENU

Redgate ReadyRoll
Extend DevOps processes to your SQL Server databases and safely automate database deployments.
Visit https://www.red-gate.com/readyroll for more information.

Copyright (C) 2011 Red Gate Software Ltd. All rights reserved.
This software contains components from Component Owl.
SQL Server is a registered trademark of Microsoft Corporation. 
Visual Studio is a registered trademark of Microsoft Corporation. 

ReadyRoll contains code from the following open source software:

NuGet https://www.nuget.org/
SQL LocalDB Wrapper https://github.com/martincostello/sqllocaldb
Autofac https://autofac.org/
Json.NET https://json.net/
MahApps.Metro http://mahapps.com/
SemVer https://github.com/maxhauser/semver
Log4Net http://logging.apache.org/log4net/
Extended WPF Toolkit https://wpftoolkit.codeplex.com/
Code InfoBox VSX http://www.codeproject.com/Articles/55196/Code-InfoBox-Visual-Studio-Extension-VSX
OctoPack https://github.com/OctopusDeploy/OctoPack
SQLite https://sqlite.org/

This product contains icons from http://www.visualpharm.com distributed under a free backlink license.

For license details or other notices relating to the above software, please see NOTICE.TXT and EULA.rtf in the ReadyRoll application folder.

Redgate SQL Prompt
Write, format, and refactor SQL effortlessly

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript tools for Visual Studio

Visual Studio Tools for Apache Cordova   15.113.6201.1
Visual Studio Tools for Apache Cordova

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 5 Eric 2017-07-04 03:21:20 UTC
Created attachment 23272 [details]
Fresh VSTS Build Logs with system.debug=true
Comment 6 Eric 2017-07-04 03:28:52 UTC
Created attachment 23273 [details]
TruckerAppDotNetStandard Source Code
Comment 7 Eric 2017-07-04 03:29:26 UTC
Created attachment 23274 [details]
VS2017 verbose build / xamarin logs
Comment 8 Eric 2017-07-04 03:30:44 UTC
I added my source code for investigation purposes and the verbose VS2017 Build Log and the recent Xamarin Logs from Help -> Xamarin.

Well, I guess that is all I can provide.
Comment 9 Rolf Bjarne Kvinge [MSFT] 2017-07-04 12:54:09 UTC
This is an incompatibility between Xamarin.Auth.dll and Microsoft.Azure.Mobile.Client.dll, they both define the ProgressLabel type with the same native name, and this is not allowed.

In fact this is an issue in Microsoft.Azure.Mobile.Client.dll, since they started including the source code from Xamarin.Auth: https://github.com/Azure/azure-mobile-apps-net-client/commit/7d259cf4653c183a9c6230480e9fc82e872d728a

You're in luck though, this was already reported (and the fix merged): https://github.com/Azure/azure-mobile-apps-net-client/issues/343.

I'm closing this since this is not a problem in Xamarin.iOS.
Comment 10 Eric 2017-07-06 05:27:04 UTC
Thanks Rolf for your support, they will release a fixed version in the next week.
Comment 11 John Miller [MSFT] 2017-10-18 13:28:00 UTC
*** Bug 60252 has been marked as a duplicate of this bug. ***