tags:

views:

182

answers:

1

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>>" %>

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"/>

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

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

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

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

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.

+2  A: 

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 Files\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.dll
C:\Program Files\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.optdata
C:\Program Files\Reference Assemblies\Microsoft\FSharp\2.0\Runtime\v2.0\FSharp.Core.sigdata

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

Brian
Tried copying both optdata and sigdata to my app's bin, same error. I also tried copying them to the FSharp.Core's directory in the GAC, same thing.
Mauricio Scheffer
Was resolved for me after copying optdata and sigdata alongside FSharp.Core.dll.
toyvo
@tovyo: for a web application?
Mauricio Scheffer