Bug 30829 - New F# Projects have a bad reference to FSharp.Core
Summary: New F# Projects have a bad reference to FSharp.Core
Status: RESOLVED ANSWERED
Alias: None
Product: Xamarin.Mac
Classification: Desktop
Component: Other ()
Version: 2.0.0
Hardware: Macintosh Mac OS
: Normal blocker
Target Milestone: ---
Assignee: Chris Hamons
URL:
Depends on:
Blocks:
 
Reported: 2015-06-05 01:10 UTC by Frank A. Krueger
Modified: 2015-06-05 22:13 UTC (History)
3 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 ANSWERED

Description Frank A. Krueger 2015-06-05 01:10:09 UTC
The reference to FSharp.Core seems to be bad.

	FSC: error FS0219: The referenced or default base CLI library 'mscorlib' is binary-incompatible with the referenced F# core library '/Library/Frameworks/Mono.framework/Versions/4.0.1/lib/mono/gac/FSharp.Core/4.3.1.0__b03f5f7f11d50a3a/FSharp.Core.dll'. Consider recompiling the library or making an explicit reference to a version of this library that matches the CLI version you are using.
	FSC: error FS0218: Unable to read assembly '/Library/Frameworks/Mono.framework/Versions/4.0.1/lib/mono/gac/FSharp.Core/4.3.1.0__b03f5f7f11d50a3a/FSharp.Core.dll'

Repro:

1. New Mac App Empty Project F#
2. Build

This is on "stable".



=== Xamarin Studio ===

Version 5.9.3 (build 1)
Installation UUID: fce13fdd-e8e3-48ef-99f1-4acbb06f0240
Runtime:
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

=== Apple Developer Tools ===

Xcode 6.3.2 (7718)
Build 6D2105

=== Xamarin.iOS ===

Version: 8.10.1.64 (Enterprise Edition)
Hash: e6ebd18
Branch: master
Build date: 2015-05-21 21:55:09-0400

=== Xamarin.Android ===

Version: 5.1.3.1 (Enterprise Edition)
Android SDK: /Users/fak/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.Mac ===

Version: 2.0.1.64 (Enterprise Edition)

=== Build Information ===

Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

=== Operating System ===

Mac OS X 10.10.3
Darwin muon.local 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Rajneesh Kumar 2015-06-05 03:01:10 UTC
I have checked this issue and able to reproduce this. To reproduce this issue I have followed the steps mention below:

1. Create a Xam.Mac Empty F# application in XS.
2. Try to build the application.
3. Observed that you will get 2 build errors.

Screencast: http://www.screencast.com/t/V9rFll3fD

Ide Logs: https://gist.github.com/Rajneesh360Logica/57d895254e95033bf196
Error Details: https://gist.github.com/Rajneesh360Logica/0df55575806282498d2d

Environment info:

=== Xamarin Studio ===

Version 5.9.4 (build 1)
Installation UUID: 011d70a5-dede-428b-ab04-ef451c2e539d
Runtime:
	Mono 4.0.1 ((detached/2a0f19e)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010056

=== Xamarin.Android ===

Version: 5.1.4.0 (Business Edition)
Android SDK: /Users/MM/Desktop/android-sdk-macosx
	Supported Android versions:
		2.3    (API level 10)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Apple Developer Tools ===

Xcode 6.2 (6776)
Build 6C131e

=== Xamarin.iOS ===

Version: 8.10.1.66 (Business Edition)
Hash: 14c4f03
Branch: master
Build date: 2015-06-02 01:21:42-0400

=== Xamarin.Mac ===

Version: 2.0.2.5 (Business Edition)

=== Build Information ===

Release ID: 509040001
Git revision: a4a0ff65f54cd4533883b8461ba800708853b6f0
Build date: 2015-06-03 06:17:49-04
Xamarin addins: c12ed369b0e05dc5c35c9350fdcbc00a46c0ff99

=== Operating System ===

Mac OS X 10.9.5
Darwin MacMini.local 13.4.0 Darwin Kernel Version 13.4.0
    Sun Aug 17 19:50:11 PDT 2014
    root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Comment 2 Chris Hamons 2015-06-05 10:37:49 UTC
@Frank - If this is what I believe it is, it is fixed in XM 2.2.

If you go into your project options / general and switch it to Unsupported Framework: Mono / .NET 4.5 it'll start "working". Or if you create a Xamarin.Mac Classic project with F#, it should work. 

We hadn't finished the infrastructure for F# with Mobile / XM 4.5 in 2.0. I should have explicitly spelled it out in the release notes. 

Thanks of the report. Sorry for the trouble.
Comment 3 Frank A. Krueger 2015-06-05 14:12:26 UTC
Why did it make it to STABLE if it wasn't complete? There needs to be a safe zone.

How long do I have to wait for XM 2.2? It's not fixed if I have to wait 2 months.

This breaks linking to my C# projects that reference the correct runtime. So F# is completely broken for me right now.
Comment 4 Chris Hamons 2015-06-05 14:51:12 UTC
XM 4.5 didn't exist before 2.0, so it wasn't something broken there, just a feature that didn't make it. The same with Mobile. F# never worked there. Unless I'm missing something or mistaken, the only cases I knew of it working were:

Xamarin.Mac Classic
Xamarin.Mac Unified Unsupported Desktop

Did you have it working somewhere else? What profile are you linking against?

I do agree, I'd preferred if we had every feature working on the new profiles before they landed in stable. 

If this is a regression, I'll see what I can do to get you patched up for sure.
Comment 5 Frank A. Krueger 2015-06-05 22:13:38 UTC
You can close this for now as the old projects are compiling again.

What happened was I switched the new project to the .NET 45 setting and that broke more things. When I reverted everything, I was able to compile again.

It would seem that the project type switcher has bugs in it too.

I haven't confirmed whether new classic API projects work but I'll take your word for it.