Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can F# TypeProviders be used in a Windows Store app?

I can't seem to figure out how to get F# TypeProviders to work in a Windows Store (C#) app.

As far as I can tell, TypeProviders can only be used in an assembly targeting the full .NET Framework, whereas Windows Store apps must target .NET Portable.

I have created an F# assembly and referenced the F# TypeProviders library, however when attempting to reference this assembly from my Windows Store app, I receive an error stating that the library could not be referenced.

Is there any way around this? I want to use F# TypeProviders to reference various data sources and then use the generated code/types in my Windows Store app. Anyone have experience with this?

UPDATE:

Just to be clear, I am asking if there is a way to use the standard F# TypeProviders (such as WsdlService) in a Windows Store App?

like image 759
Joshua Avatar asked Jan 12 '13 03:01

Joshua


2 Answers

Looking at the other assemblies FSharp.Data.TypeProviders.dll is referencing, I don't think there is a way around this. Since most type providers are used for accessing a database in one way or another (ADO.NET, LINQ to SQL, EF), it references System.Data.dll which is not available in WinRT.

The only data sources supported by built-in type providers that can be used in WinRT are web services and OData services. Their type providers maybe could be supported in a WinRT project if they were implemented in a separate library, but not in their current implementation.

like image 124
Damir Arh Avatar answered Sep 28 '22 11:09

Damir Arh


Type providers are design/compile time facility. It should work in Portable library profile. It is maybe dependent on how is type provider library implemented, but in general, it should work.

For more info see F# type providers with Portable Library

like image 35
Aleš Roubíček Avatar answered Sep 28 '22 12:09

Aleš Roubíček