F# PowerPack Target Runtime

[亡魂溺海] 提交于 2019-11-28 05:46:55

问题


The pre-built binaries for the F# PowerPack are compiled against the .NET 2.0 runtime. If I have a .NET 4.0 project, is there any advantage to compiling the PowerPack source for the .NET 4 runtime?


回答1:


I used .NET 2.0 version of F# PowerPack in F# snippets web site, which is a .NET 4.0 ASP.NET project. The only disadvantage of not using 4.0 version was that I had to add configuration to load 4.0 version of FSharp.Core.dll when looking for 2.0 version (which is referenced by the 2.0 version of PowerPack).

I had to add something like the following and then it worked just fine:

<configuration>
  <!-- ... -->
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" />
      <bindingRedirect oldVersion="2.0.0.0" newVersion="4.0.0.0" />
    </dependentAssembly>
  </assemblyBinding>
  </runtime>
</configuration>



回答2:


My app.config for older .NET is

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>

but power pack installs and works well on VS2010 and .NET4 fsproj



来源:https://stackoverflow.com/questions/4566858/f-powerpack-target-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!