Rob Lyndon
Rob Lyndon

Reputation: 12651

F#, Visual Studio 2017 and dotnet new

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.

Upvotes: 4

Views: 556

Answers (1)

Joe Clay
Joe Clay

Reputation: 35787

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:

(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).

Upvotes: 7

Related Questions