【发布时间】:2020-12-06 22:18:29
【问题描述】:
根据https://docs.microsoft.com/en-us/dotnet/standard/frameworkssl5 是SDK 样式项目支持的目标框架。
我的项目文件是:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;sl5</TargetFrameworks>
</PropertyGroup>
</Project>
但是,我无法构建它:
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.
我可以构建任何将被 Silverlight 项目识别的目标框架。所以,如果有 sl5 的替代品 - 也可以。
附言
请不要问我为什么需要构建 Silverlight 项目。
【问题讨论】:
-
不足为奇。他们通常会忘记删除他们不想再支持的东西。
-
这不是很有帮助:-(
-
如果您寻找替代品,github.com/dotnet/sdk/issues/8779 和 github.com/novotnyllc/MSBuildSdkExtras 应该是您的指南。只需在 Google 上点击几下。
-
@LexLi - 请将您的评论转换为答案。我能够使用 MSBuild.Sdk.Extras 构建 sl5,尽管使用了 msbuild。
-
@LexLi - 你能看看stackoverflow.com/questions/63476439/… 吗?
标签: c# .net-core silverlight