Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

F#, Visual Studio 2017 and dotnet new

Tags:

.net-core

f#

To create a .NET class library from the command line, you can run the script

dotnet new classlib

Do that in a clean folder, and it will create a csproj file that can then be opened in Visual Studio 2017.

However, run the script

dotnet new classlib -lang f#

in a clean folder, and the fsproj file that is subsequently create cannot be opened in Visual Studio 2017. The error message reads

The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\FSharp.NET.Sdk\Sdk\Sdk.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I have searched for clarification of this issue, and it appears that there is work ongoing to fix it, but I wondered in the interim if there are any add-ins I can install to get this working immediately.

like image 321
Rob Lyndon Avatar asked Mar 09 '23 12:03

Rob Lyndon


1 Answers

The latest preview releases of Visual Studio and .NET Core support loading .fsproj projects, apparently.

See this comment on the GitHub issue:

Closing this now, as these projects load with 15.3. The current way to use them:

  • Download VS 2017 Update 3 Preview 3 (or a further preview if it's released and you're reading this)
  • Download the latest CLI/SDK from here: https://github.com/dotnet/cli/tree/release/2.0.0#installers-and-binaries

(Yes, the .NET SDK is independent of VS. You will also need this to get .NET Core 2.0 support in VS 2017 Update 3 Previews).

like image 108
Joe Clay Avatar answered Mar 11 '23 05:03

Joe Clay