msbuild - Creating a F# PCL for Universal apps (a.k.a. Store Apps or Windows apps or WinRT apps) -


since visual studio 2013 update 2, possible create portable class libraries (pcls) can reference windows runtime types (which not possible before) long target windows 8.1 , windows phone 8.1 , no other targets.

i tried in c# adding c# class library (portable universal apps) , works, means can consume , produce windows runtime types if project windows app or windows runtime component.

since f# supports pcls , windows 8.1 , windows phone 8.1 supported targets, achieve same f# pcls (if possible). while visual studio 2013 update 4 not offer creating f# pcls target windows 8.1 , windows phone 8.1, possible modify .fsproj file of f# pcl match .csproj file of c# pcl targets created visual studio. requires changing xml elements following:

<targetframeworkversion>v4.6</targetframeworkversion> <targetframeworkprofile>profile32</targetframeworkprofile> 

and adding following <itemgroup>

<targetplatform include="windowsphoneapp, version=8.1" /> <targetplatform include="windows, version=8.1" /> 

after these changes, able consume , produce windows runtime types in f# pcl in c# pcl (without complaints visual studio in f# pcl or c# (universal) windows app), when run (universal) windows app following exception when function uses windows runtime types called in f# pcl c# (universal) windows app:

an exception of type 'system.io.filenotfoundexception' occurred in [application name].exe not handled in user code

additional information: not load file or assembly 'windows, version=255.255.255.255, culture=neutral, publickeytoken=null' or 1 of dependencies. system cannot find file specified.

when check references in solution explorer of visual studio, c# pcl shows reference named windows, missing f# pcl. reference properties of reference this:

properties of windows reference

i tried adding reference manually .fsproj file of f# pcl adding

<reference include="c:\program files (x86)\microsoft sdks\portable\v12.0\110c4feff2ba61c0746933a9ed6e248d\windows.winmd" /> 

to <itemgroup>. after this, reference show in f# pcl in solution explorer following reference properties:

enter image description here

but not fix problem. is, still same exception before.

i tried copying , pasting windows reference via context menu of solution explorer of visual studio, complains error message.

do know how add windows reference f# pcl? awesome, because make possible write (universal) windows apps entirely in f#! if know fact not possible, please explain preventing being possible?

edit: improved formatting of exception message

you're making portable class library. f# not support windows store apps, way can use f# in such situation call c#. if manage succeed, you'll first of anyone.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -