Bug 12845 - Portable Class library support in Alpha 4.1.4 build 117 on Mac failing to fine mscorlib
Summary: Portable Class library support in Alpha 4.1.4 build 117 on Mac failing to fin...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model (show other bugs)
Version: 4.1
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: master
Assignee: Martin Baulig
Depends on:
Reported: 2013-06-24 07:03 UTC by Mike Jones
Modified: 2013-07-16 04:55 UTC (History)
3 users (show)

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


Description Mike Jones 2013-06-24 07:03:42 UTC
When I create or load a PCL, it seems that it does not find mscorlib.dll and errors with the following:

Error CS0518: The predefined type `System.Object' is not defined or imported (CS0518) 

And all other primitive types are missing with simular errors.

To replicate
create, a new portable class library and try building it.

temp fix
Add reference to mscorlib.dll in PCL project (normatlly found in /Library/Frameworks/Mono.Framework/Libraries/mono/v4.5/mscorlib.dll).
Comment 1 Martin Baulig 2013-07-03 10:13:07 UTC
This alpha build did not include the PCL Reference Assemblies which are required to build any PCL projects.  There will be a new alpha available shortly.
Comment 2 Roger Peters 2013-07-15 16:08:40 UTC
I've run into this same issue. I had been building fine, but now a portable library I created a while back will no longer compile without errors like Mike listed. I tried his suggestion of referencing another mscorlib.dll, but I am just ending up with other build errors now in projects that reference the portable library project (ex: System.Uri is defined in an assembly that is not referenced).

I'm not sure what happened, but it broke me from building. I think I'm going to just get rid of the portable library and try to go from there.
Comment 3 Mike Jones 2013-07-16 04:55:27 UTC
Xamarin do seem to have fixed this issue with the latest alpha build, if you have that build, you can easily sort out the issue. If you create an portable class library from scratch, and build it you should still see the same errors, however, if you then go to the project options (right click on the project in solution explorer and then select 'options') and tick the boxes of the Frameworks you want to support, it should then build just fine for you.

Otherwise, you can still do my temp fix, you just need to select the system.dll system.core.dll and any other dependancies needed to build the PCL, you can find all the system dlls in /Library/Frameworks/Mono.Framework/Libraries/mono/v4.5/ 

Hope that helps.

Note You need to log in before you can comment on or make changes to this bug.