简体   繁体   English

如何使用.NET Standard 2.0作为目标框架创建F#库?

[英]How to create an F# library with target framework as .NET Standard 2.0?

I am trying to create an F# class library with target framework as .NET Standard 2.0. 我正在尝试创建一个目标框架为.NET Standard 2.0的F#类库。 When I try to create a new project in Visual Studio 2017, I don't see any option to create a class library with target framework as .NET Standard 2.0 (attached screenshot) 当我尝试在Visual Studio 2017中创建新项目时,看不到使用目标框架创建为.NET Standard 2.0的类库的任何选项(附加屏幕截图) 在此处输入图片说明

When trying to create an F# project, I see a bunch of options to create projects in .NET framework or the option to create an ASP.NET Core web application (which uses .NET Core). 尝试创建F#项目时,我看到了很多在.NET框架中创建项目的选项或创建ASP.NET Core Web应用程序(使用.NET Core)的选项。

Can someone help me how to create an F# library with target framework as .NET Standard 2.0? 有人可以帮我如何使用目标框架(如.NET Standard 2.0)创建F#库吗?

You don't normally directly target .NET Standard when creating project, with class libraries being the exception. 通常,创建项目时通常不会直接针对.NET Standard,但类库除外。 .NET Standard is a specification that the different .NET platforms implement. .NET Standard是不同.NET平台实施的规范。 For example, if you were creating a new asp.net project that targets .NET Core, you would need to target .Net Core 2.0 in order to indirectly target .NET Standard 2.0. 例如,如果要创建一个针对.NET Core的新asp.net项目,则需要针对.Net Core 2.0,以便间接针对.NET Standard 2.0。

The following link explains this further and also shows the version of .NET Standard supported by each .Net platform: 下面的链接对此进行了进一步说明,并显示了每个.Net平台支持的.NET Standard版本:

https://docs.microsoft.com/en-us/dotnet/standard/net-standard https://docs.microsoft.com/en-us/dotnet/standard/net-standard

When creating class libraries, you can choose to directly target .NET Standard by following these steps (Visual Studio 2017): 创建类库时,您可以按照以下步骤(Visual Studio 2017)选择直接定位.NET Standard:

  1. From the File >> New >> Project dialog, expand the tree for your desired language (in your case F#). 从文件>>新建>>项目对话框中,展开所需语言(在您的情况下为F#)的树。
  2. Select the .NET Standard node. 选择“ .NET Standard”节点。
  3. Select 'Class Library (.NET Standard)' as a project type. 选择“类库(.NET Standard)”作为项目类型。

新建项目对话框

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

相关问题 如何定位.NET Standard 2.0? - How to target .NET Standard 2.0? 如何创建针对.NET 2.0和.NET Standard的库? - How to create a library that targets both .NET 2.0 and .NET Standard? F# 柯里化 .NET 标准库函数多参数? - F# currying .NET standard library functions with multiple parameters? 如何在 Visual Studio 中从我的 .NET 框架项目中定位 .NET 标准 2.0? - How do I target .NET Standard 2.0 from my .NET Framework project in Visual Studio? 向以.NET Standard 4.5为目标的Xamarin PCL添加针对.NET标准2.0的类库的引用 - Add a reference to a class library which target .NET standard 2.0 to a Xamarin PCL which targets .NET Standard 4.5 在 F#/.NET 中实现标准 ML 签名 - Implementing Standard ML signatures in F# / .NET Service Fabric-创建net core 2.0项目,但目标框架为4.6 - Service Fabric - create net core 2.0 project, but target framework is 4.6 创建库.tar Framework 4.5和.Net Standard - Create library targeting .Net Framework 4.5 and .Net Standard 如何在VS 2017 RC中创建针对.NET Framework 4.5.1和.NET Standard 1.3的库? - How should I create a library targetting .NET Framework 4.5.1 and .NET Standard 1.3 in VS 2017 RC? 如何将 .NET 标准库更改为 .NET 框架库? - How can I change a .NET standard library to a .NET framework library?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM