Bug 52590 - Cannot compile for iOS, TypeBuilder exists in two places.
Summary: Cannot compile for iOS, TypeBuilder exists in two places.
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: BCL Class Libraries ()
Version: XI 10.4 (C9)
Hardware: PC Windows
: --- normal
Target Milestone: C9SR0
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2017-02-16 23:31 UTC by Brad Chase
Modified: 2017-03-09 22:51 UTC (History)
5 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 FIXED

Description Brad Chase 2017-02-16 23:31:03 UTC
I upgraded from 8 to 9 and I receive this error on compiling now for iOS:

errors:

Severity Code Description Project File Line Suppression State
Error CS0433 The type 'TypeBuilder' exists in both 'Mono.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' and 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

AND

Severity Code Description Project File Line Suppression State
Error CS0433 The type 'FieldBuilder' exists in both 'Mono.CSharp, Version=2.0.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' and 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'


I tried to put in an extern alias but I am still failing at multiple places now at runtime.
Comment 1 Sebastien Pouliot 2017-02-17 02:08:57 UTC
This fails when compiling with the C# compiler

@Marek any guidance you can offer ?
Comment 2 Marek Safar 2017-02-17 12:45:28 UTC
Hmm, this is not very good. Do you intentionally explicitly reference Mono.CSharp?
Comment 3 Brad Chase 2017-02-17 14:04:30 UTC
@Marek Was that aimed at me?  I don't do anything normally outside of the norm.  I have the mono.csharp in my references the same as always until 9 where it started throwing this error directly after upgrading.  It was fine on 8, no other changes.

Any idea on how to temporarily get around this?  I remember this happening before and some stubs had to be out in, this was years ago on earlier versions.
Comment 4 Brad Chase 2017-02-17 14:05:52 UTC
Uhhh sorry type in phone, but stubs put in.
Comment 5 Marek Safar 2017-02-18 14:33:29 UTC
This is an issue on our end and it's being worked on right now. The only fix I can think of is to remove Mono.CSharp reference or if you use it you need to alias the reference in project settings and then `extern alias` in C# code
Comment 6 Brad Chase 2017-02-18 16:09:38 UTC
Yea I did extern alias but I had a bunch of other issues after that.  They might be separate issues involved in 9.  I'll look more into it when I have time to go test again.
Comment 7 Marek Safar 2017-02-20 16:33:46 UTC
Fixed in master
Comment 8 Brad Chase 2017-02-23 16:34:36 UTC
Do we know what release this will be in?  It is not in the cycle 9 stable.
Comment 9 Marek Safar 2017-02-24 09:42:10 UTC
No but it should appear in cycle 9 service release