简体   繁体   English

F#,Visual Studio 2017和dotnet new

[英]F#, Visual Studio 2017 and dotnet new

To create a .NET class library from the command line, you can run the script 要从命令行创建.NET类库,可以运行该脚本

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. 在干净的文件夹中执行此操作,它将创建一个csproj文件,然后可以在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 在一个干净的文件夹中,并且无法在Visual Studio 2017中打开随后创建的fsproj文件。错误消息显示为

The imported project "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\Sdks\\FSharp.NET.Sdk\\Sdk\\Sdk.props" was not found. 未找到导入的项目“C:\\ Program Files(x86)\\ Microsoft Visual Studio \\ 2017 \\ Professional \\ MSBuild \\ Sdks \\ FSharp.NET.Sdk \\ Sdk \\ Sdk.props”。 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. 我已经搜索了这个问题的说明,似乎正在进行修复工作,但我想在过渡期间是否有任何加载项我可以安装以立即开始工作。

The latest preview releases of Visual Studio and .NET Core support loading .fsproj projects, apparently. Visual Studio和.NET Core的最新预览版显然支持加载.fsproj项目。

See this comment on the GitHub issue: 在GitHub问题上看到这条评论:

Closing this now, as these projects load with 15.3. 现在关闭这个,因为这些项目加载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). (是的,.NET SDK独立于VS.您还需要这个以在VS 2017 Update 3预览中获得.NET Core 2.0支持)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM