[英]How to build an SDK style project for the sl5 target framework?
According to https://docs.microsoft.com/en-us/dotnet/standard/frameworks sl5
is a supported target framework for an SDK style project.根据https: sl5
是 SDK 风格项目的受支持目标框架。
My project file is:我的项目文件是:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;sl5</TargetFrameworks>
</PropertyGroup>
</Project>
Yet, I cannot build it:但是,我无法构建它:
C:\DataSourceCodeGenerator.Attributes [master ≡ +0 ~1 -0 !]> dotnet build Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
Restored C:\DataSourceCodeGenerator.Attributes\src\DataSourceCodeGenerator.Attributes\DataSourceCodeGenerator.Attributes.csproj (in 176 ms).
C:\Program Files\dotnet\sdk\3.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(93,5): error NETSDK1013: The TargetFramework value 'sl5' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [C:\DataSourceCodeGenerator.Attributes\src\DataSourceCodeGenerator.Attributes\DataSourceCodeGenerator.Attributes.csproj]
DataSourceCodeGenerator.Attributes -> C:\DataSourceCodeGenerator.Attributes\src\DataSourceCodeGenerator.Attributes\bin\Debug\netstandard2.0\DataSourceCodeGenerator.Attributes.dll
Build FAILED.
I am OK to build any target framework that will be recognized by a Silverlight project.我可以构建任何将被 Silverlight 项目识别的目标框架。 So, if there is an alternative to sl5
- that works too.所以,如果有sl5
的替代品 - 那也可以。
PS附言
Please, do not ask why I need to build a Silverlight project.请不要问我为什么需要构建一个 Silverlight 项目。
Copied from the comments.从评论中复制。
Microsoft documentation can be inaccurate in certain pages, and I believe this is one of such pages. Microsoft 文档在某些页面中可能不准确,我相信这是此类页面之一。
You cannot use .NET Core SDK's default settings to multi target Silverlight platforms, but with some help from the open source MSBuild.Sdk.Extras
you can achieve the same.您不能将 .NET Core SDK 的默认设置用于多目标 Silverlight 平台,但在开源MSBuild.Sdk.Extras
的一些帮助下,您可以实现相同的目标。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.