简体   繁体   English

如何为 sl5 目标框架构建一个 SDK 风格的项目?

[英]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的一些帮助下,您可以实现相同的目标。

References参考

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

相关问题 类库包:sl5目标问题 - Class Library Package : sl5 target issue 如何在VS中创建SDK风格的.NET Framework项目? - How to create an SDK-style .NET Framework project in VS? 无法以编程方式安装 OOB SL5 - Unable to install OOB SL5 programmatically 如何在自定义 NuGet package 安装时添加/更新目标项目的属性(SDK 样式格式)? - How to add/update properties of a target project (SDK Style Format) upon custom NuGet package install? 如何在使用 Visual Studio 时为 .net 框架 4.7.2 项目创建 SDK 样式项目? - How do I reate an SDK style project for a .net framework 4.7.2 project in using visual studio? 升级到1.0.1后,SL5中的SignalR停止工作 - SignalR in SL5 stops working after upgrade to 1.0.1 如何更改ASP 5项目的目标框架版本? - How to change the target framework version of asp 5 project? .NET Framework SDK如何与可用的目标框架相关联? - How does .NET Framework SDK relate to available target frameworks? Microsoft.Build.Engine错误(默认目标):目标GetFrameworkPaths:无法找到.NET Framework SDK - Microsoft.Build.Engine Error (default targets): Target GetFrameworkPaths: Could not locate the .NET Framework SDK SL5 + MEF + PRISM + DataGrid +在模态对话框中编辑行:InteractionRequest是答案吗? - SL5 + MEF + PRISM + DataGrid + Edit Rows in Modal Dialog: Is InteractionRequest the Answer?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM