10

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.

Mauricio Scheffer
  • 98,863
  • 23
  • 192
  • 275
  • Could you upload your current project somewhere? I'd be happy to try it, but it would be useful to have some project to start with :-). – Tomas Petricek Apr 29 '10 at 09:26
  • @Tomas: thanks, I'll try to create a small project that reproduces this. – Mauricio Scheffer Apr 29 '10 at 14:57
  • @Tomas: here's the project: http://www.box.net/shared/7xnkfg5yps – Mauricio Scheffer Apr 30 '10 at 02:22
  • I have a similar problem. However it's temporary. on my CI server one build works fine the other fails when looking for sigdata. They use the exact same build script. The only dif between them is what happens afterwards when there's no ubild errors – Rune FS Jul 06 '11 at 12:25

1 Answers1

13

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
  • 117,631
  • 17
  • 236
  • 300