8
votes

I'm trying to using FSharp.Data in a script file on a FSharp project, and the error that I'm receiving is:

Warning '..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll' is not a valid assembly name.

FSharp.Data from https://www.nuget.org/packages/FSharp.Data/

It's the same problem if I try with a F# project for .NET 4.0, .NET 4.5 or .NET 4.6.

EDIT: It works fine with '..\packages\FSharp.Data.2.2.5\lib\portable-net40+sl5+wp8+win8\FSharp.Data.dll' but in this portable version only web locations are supported.

1
I had no troubles using the net40 version in VS 2015. Can you post your exact code? (Is everything escaped correctly? Is the relative path correct?) - Tomas Petricek
There is no code, just the line to use the assembly. #r "..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll" I got the same error using a VS 2012 instance. I'm thinking that maybe it is a problem with my .NET or VS instances. - J. Lennon
That's still code :) - Tomas Petricek

1 Answers

9
votes

I think the problem is string escaping. In the following:

#r "..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll"

The \n is interpreted as a new-line character and so it is invalid. But in the following:

#r "..\packages\FSharp.Data.2.2.5\lib\portable-net40+sl5+wp8+win8\FSharp.Data.dll"

.. there are no special escape sequences in the string. Both of the following should work:

#r @"..\packages\FSharp.Data.2.2.5\lib\net40\FSharp.Data.dll"
#r "..\\packages\\FSharp.Data.2.2.5\\lib\\net40\\FSharp.Data.dll"