3

how do I best reference a system assembly, that has no NuGet package, in VS Code with Paket in an F# project or script?

Example: System.Data.Linq.dll.

One way is to hard reference the file, e.g. like this:

#r @"C:/Windows/Microsoft.NET/Framework/v4.0.30319/System.Data.Linq.dll"

But is there a better / portable solution? How does this work with Mono or .NET Core?

leifbattermann
  • 622
  • 7
  • 12
  • 6
    In full .NET and in Mono you can simply use `#r "System.Data.Linq"` and F# will find the correct assembly. I'm not sure about .NET Core though. – Tarmil Sep 19 '16 at 12:00
  • @Tarmil Thx, I didn't know that. This is so easy that I haven't considered it. – leifbattermann Sep 19 '16 at 12:10

1 Answers1

0

for a F# project in VSCode I include the reference in the .fsproj file.

<ItemGroup>
  <!-- Other includes and stuff -->
  <Reference Include="System.Data.Linq" />
  <!-- Other includes and stuff -->
</ItemGroup>

Not sure how it works on .NET Core and Mono

Stefanpu
  • 1
  • 2
  • 2