Dylan
Dylan

Reputation: 1306

Is it possible to use F# with the new Windows Universal apps?

Now that we can write F# apps for iPhone and Android thanks to the folks at Xamarin, I'm really surprised that it's such a pain to get F# going with Windows Phone. I just tried to add an F# project to an WinPhone 8.1 (RT based) project and get a rather unhelpful "Unable to add a reference to project ..." from Visual Studio 2013. I've added a reference to FSharp.Core from the portable libs folder (Version 2.3.5.1). I believe it can still be done with 8.1 Silverlight apps, but that kind of hoops the whole universal app idea.

Does anyone know if it's possible with some csproj hacks or anything? I'm very naïve when it comes to portable libs and how they work.

The brand new Win 10 apps don't support F# seemingly because of the .NET Native initiative. You can vote for F# support here https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/9110134-f-support-in-net-native-for-uwp

[Update]

I believe it may now be possible with the Centennial bridge https://developer.microsoft.com/en-us/windows/bridges/desktop

Upvotes: 19

Views: 2183

Answers (2)

J D
J D

Reputation: 48687

Does anyone know if it's possible with some csproj hacks or anything?

As far as I know, not possible. This has been a disaster for Microsoft, BTW. A major client of ours wanted tens of thousands of tablets and they took Microsoft tablets off the table because they don't support F#.

Upvotes: 2

Jarle Stabell
Jarle Stabell

Reputation: 31

This seems to be classified as a bug at this moment: https://connect.microsoft.com/VisualStudio/feedback/details/845740/unable-to-add-reference-to-f-pcl-project-from-windows-phone-8-1-universal-project

The current workaround, as mentioned in the above link, is to add a reference to the resulting assembly/dll from your F# project directly (ie use "Browse" and point it to your "F#-based" dll), instead of adding a reference to your F# project. (At least this seems to work when using it in combination with FSharp.Core 3.3.1.0)

Upvotes: 3

Related Questions