简体   繁体   中英

Targeting .NET Core 2.0

I just create a simple ClassLibrary project with VS2017 preview 2.1. I create using .NET Core project template. When I check in project details, I see it targets .NET standard 2.0. How I may target .NET Core 2.0 (that implement a larger number of API according to a test made with API-Port tool)

Update: The templates have been fixed in a recent update to VS 2017 15.3 Preview.

This really looks like an issue with the templates, I also created a project from the "Class Library (.NET Core)" template and it targeted .NET Standard 2.0.

However, this can easily be fixed by editing the csproj file manually from

<TargetFramework>netstandard2.0</TargetFramework>

to

<TargetFramework>netcoreapp2.0</TargetFramework>

This project type allows editing the csproj file while the project is loaded by right-clicking on the project and selecting "Edit {project}.csproj".

看起来您可能会创建一个针对.NET Core 2.0的VS2017的.NET Core应用程序,但是一旦创建了.NET Core项目库,它就会以.NET标准为目标,这可能是VS2017预览的限制。

VS2017 15.3.0预览3问题已经消失了!

I'm on Visual Studio 2017: Community.

I installed the SDK found here: https://www.microsoft.com/net/download/thank-you/dotnet-sdk-2.1.3-windows-x64-installer

You should be able to see the NET Core 2.0 as the target framework when creating your project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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