簡體   English   中英

使用F#創建Silverlight 3應用程序

[英]Creating Silverlight 3 applications with F#

是否有使用F#(十月CTP)創建Silverlight 3應用程序的簡便方法? 我已經看到了SilverlightF# ,但這僅適用於May CTP。

我正在使用Visual Studio Integrated Shell 2008。

可以將May CTP模板與F#的October CTP版本一起使用

創建您的新項目,然后將其卸載並編輯FSharp.Core.dll的提示路徑,使其指向十月份的CTP,

<HintPath>$(ProgramFiles)\fsharp-1.9.7.8\Silverlight\2.0\bin\FSharp.Core.dll</HintPath>

然后重新加載項目並進行構建。

您確實必須通過例如使用chiron工具手動打包.xap文件(或僅壓縮和重命名)

AppManifest.xaml文件看起來像

<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
            RuntimeVersion="3.0.40818.0" 
            EntryPointAssembly="astroclock-fs" 
            EntryPointType="astroclock.fs.MyApp">
  <Deployment.Parts>
    <AssemblyPart x:Name="astroclock-fs" Source="astroclock-fs.dll" />
    <AssemblyPart x:Name="FSharp.Core" Source="FSharp.Core.dll" />
  </Deployment.Parts>
</Deployment>

在這里您填寫自己的程序集名稱和入口點,而不是我的

在$(ProjectDir)中創建一個文件夾,以保存要打包的所有文件,並將C:\\ Program Files \\ FSharp-1.9.7.8 \\ Silverlight \\ 2.0 \\ bin \\ FSharp.Core.dll和AppManifest.xaml復制到其中以上

如果使用該工具,請在文件夾中創建一個空文件null.py以保持Chiron安靜

添加以下構建后步驟

cd $(ProjectDir)
copy /y $(OutDir)$(TargetFileName) [your directory with all the output] 
"C:\Program Files\IronPython 2.0\Silverlight\bin\chiron.exe" /d:[your directory with all the output] /z:app.xap

創建一個測試頁面以加載app.xap

建立項目

在瀏覽器中加載頁面並享受

添加

您可以通過在C:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ Common7 \\ IDE \\ ProjectTemplatesCache \\ FSharp \\ Silverlight \\ SilverlightLibrary3.zip \\ SilverlightLibrary中編輯模板,對找到FSharp.Core.dll所需的提示路徑進行永久性修復。 fsproj(當然可以確定C:\\ Program Files \\ Microsoft Visual Studio 9.0 \\ Common7 \\ IDE \\ ProjectTemplates \\ FSharp \\ Silverlight \\ SilverlightLibrary3.zip中文件的版本)。

和(捆綁在XAP源和一切)概念的工作證明這里

看來我必須等待VS 2010

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM