FSharp.Core.sigdata 未与 FSharp.Core 一起找到 [英] FSharp.Core.sigdata not found alongside FSharp.Core

查看:15
本文介绍了FSharp.Core.sigdata 未与 FSharp.Core 一起找到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 F# 用于 ASP.NET MVC 应用程序.一个我的控制器操作向视图发送一个 F# 列表,所以我写:

I'm trying to use F# for an ASP.NET MVC application. One my controller actions sends an F# list to the view, so I write:

<%@ Page Language="C#" Inherits="ViewPage<FSharpList<int>>" %>

当然,要使其正常工作,我必须将 Microsoft.FSharp.Collections 添加到 namespaces 元素:

Of course, for this to work, I have to add Microsoft.FSharp.Collections to the namespaces element in my web.config:

<add namespace="Microsoft.FSharp.Collections"/>

并添加对 FSharp.Core 的引用,在 组件 元素:

and add a reference to FSharp.Core, in the assemblies element:

<add assembly="FSharp.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

一旦我添加了这个程序集引用,每个视图(无论是否使用 F# 类型)都会失败并显示此错误:

As soon as I add this assembly reference, every view (whether it uses an F# type or not) fails with this error:

错误 FS1221:未在 FSharp.Core 旁边找到 FSharp.Core.sigdata

error FS1221: FSharp.Core.sigdata not found alongside FSharp.Core

我可以通过在我的视图中没有任何 F# 特定类型来解决这个问题,但是这个错误的原因是什么?另外,FSharp.Core.sigdata 在哪里?它不在我的 GAC 中,我在任何地方都找不到.

I can work around this by not having any F# specific types in my views, but what's the reason for this error? Also, where's FSharp.Core.sigdata ? It's not in my GAC and I can't find it anywhere.

推荐答案

您会在参考程序集中找到它,因为 sigdata 和 optdata 是设计时的东西(但我猜 CodeDom 也需要它们?),例如:

You'll find it with the Reference Assemblies, as sigdata and optdata are design-time things (but I guess CodeDom needs them too?), e.g.:

C:Program FilesReference AssembliesMicrosoftFSharp2.0Runtimev2.0FSharp.Core.dll
C:Program FilesReference AssembliesMicrosoftFSharp2.0Runtimev2.0FSharp.Core.optdata
C:Program FilesReference AssembliesMicrosoftFSharp2.0Runtimev2.0FSharp.Core.sigdata

如果您复制应用正在使用的 FSharp.Core 旁边的那些,它可能会工作.

If you copy those next to the FSharp.Core that the app is using, it will probably work.

这篇关于FSharp.Core.sigdata 未与 FSharp.Core 一起找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆