<legend id='vYfjP'><style id='vYfjP'><dir id='vYfjP'><q id='vYfjP'></q></dir></style></legend>

<small id='vYfjP'></small><noframes id='vYfjP'>

    <i id='vYfjP'><tr id='vYfjP'><dt id='vYfjP'><q id='vYfjP'><span id='vYfjP'><b id='vYfjP'><form id='vYfjP'><ins id='vYfjP'></ins><ul id='vYfjP'></ul><sub id='vYfjP'></sub></form><legend id='vYfjP'></legend><bdo id='vYfjP'><pre id='vYfjP'><center id='vYfjP'></center></pre></bdo></b><th id='vYfjP'></th></span></q></dt></tr></i><div id='vYfjP'><tfoot id='vYfjP'></tfoot><dl id='vYfjP'><fieldset id='vYfjP'></fieldset></dl></div>

    • <bdo id='vYfjP'></bdo><ul id='vYfjP'></ul>

      1. <tfoot id='vYfjP'></tfoot>

        在 csproj 文件中进行多目标时生成错误

        Build errors when multi-targeting in csproj file(在 csproj 文件中进行多目标时生成错误)

      2. <tfoot id='WR3PC'></tfoot>
          <tbody id='WR3PC'></tbody>

              <bdo id='WR3PC'></bdo><ul id='WR3PC'></ul>
            • <small id='WR3PC'></small><noframes id='WR3PC'>

            • <legend id='WR3PC'><style id='WR3PC'><dir id='WR3PC'><q id='WR3PC'></q></dir></style></legend>

              <i id='WR3PC'><tr id='WR3PC'><dt id='WR3PC'><q id='WR3PC'><span id='WR3PC'><b id='WR3PC'><form id='WR3PC'><ins id='WR3PC'></ins><ul id='WR3PC'></ul><sub id='WR3PC'></sub></form><legend id='WR3PC'></legend><bdo id='WR3PC'><pre id='WR3PC'><center id='WR3PC'></center></pre></bdo></b><th id='WR3PC'></th></span></q></dt></tr></i><div id='WR3PC'><tfoot id='WR3PC'></tfoot><dl id='WR3PC'><fieldset id='WR3PC'></fieldset></dl></div>

                • 本文介绍了在 csproj 文件中进行多目标时生成错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试构建一个同时面向 .NET 4.5.1 和 .NET Standard 1.3 的类库.根据 文档,我应该可以做到这一点:

                  I'm trying to build a class library that multi-targets both .NET 4.5.1 and .NET Standard 1.3. According to the documentation, I should be able to do this:

                  <PropertyGroup>
                    <TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
                  </PropertyGroup>
                  

                  但是,当我尝试构建时,我得到了这些奇怪的错误:

                  However, when I try to build, I get these odd errors:

                  无法从 TargetFramework='net451' 推断 TargetFrameworkIdentifier 和/或 TargetFrameworkVersion.必须明确指定它们.

                  Cannot infer TargetFrameworkIdentifier and/or TargetFrameworkVersion from TargetFramework='net451'. They must be specified explicitly.

                  MSB3645 .NET Framework v3.5 Service Pack 1 未找到.为了定位.NETFramework,Version=v1.3",必须安装 .NET Framework v3.5 Service Pack 1 或更高版本.

                  MSB3645 .NET Framework v3.5 Service Pack 1 was not found. In order to target ".NETFramework,Version=v1.3", .NET Framework v3.5 Service Pack 1 or later must be installed.

                  MSB3644 框架.NETFramework,Version=v1.3"的参考程序集没有找到.要解决此问题,请为此框架版本安装 SDK 或 Targeting Pack,或者将您的应用程序重新定位到已安装 SDK 或 Targeting Pack 的框架版本.请注意,程序集将从全局程序集缓存 (GAC) 中解析,并将用于代替引用程序集.因此,您的程序集可能无法正确定位于您想要的框架.

                  MSB3644 The reference assemblies for framework ".NETFramework,Version=v1.3" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

                  如果我手动指定目标框架标识符,它构建得很好:

                  If I specify the target framework identifiers manually, it builds fine:

                  <PropertyGroup>
                    <TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
                  </PropertyGroup>
                  <PropertyGroup Condition="'$(TargetFramework)' == 'net451'">
                    <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
                  </PropertyGroup>
                  <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
                    <TargetFrameworkIdentifier>.NETStandard</TargetFrameworkIdentifier>
                  </PropertyGroup>
                  

                  我正在使用 Visual Studio 2017 社区.我在这里做错了吗?

                  I'm using Visual Studio 2017 Community. Am I doing something wrong here?

                  推荐答案

                  你确定写了吗

                  <TargetFrameworks>net451;netstandard1.3</TargetFrameworks>

                  而不是

                  <TargetFramework>net451;netstandard1.3</TargetFramework>

                  ?

                  在添加缺少的 s

                  这篇关于在 csproj 文件中进行多目标时生成错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)
                  CreateDelegate with unknown types(具有未知类型的 CreateDelegate)
                  Does Funclt;Tgt;.BeginInvoke use the ThreadPool?(Funclt;Tgt;.BeginInvoke 使用线程池吗?)
                  How to create a delegate to an instance method with a null target?(如何为具有空目标的实例方法创建委托?)
                    1. <legend id='4HhjT'><style id='4HhjT'><dir id='4HhjT'><q id='4HhjT'></q></dir></style></legend>
                        <tbody id='4HhjT'></tbody>
                      <i id='4HhjT'><tr id='4HhjT'><dt id='4HhjT'><q id='4HhjT'><span id='4HhjT'><b id='4HhjT'><form id='4HhjT'><ins id='4HhjT'></ins><ul id='4HhjT'></ul><sub id='4HhjT'></sub></form><legend id='4HhjT'></legend><bdo id='4HhjT'><pre id='4HhjT'><center id='4HhjT'></center></pre></bdo></b><th id='4HhjT'></th></span></q></dt></tr></i><div id='4HhjT'><tfoot id='4HhjT'></tfoot><dl id='4HhjT'><fieldset id='4HhjT'></fieldset></dl></div>
                        <bdo id='4HhjT'></bdo><ul id='4HhjT'></ul>

                          <tfoot id='4HhjT'></tfoot>

                        1. <small id='4HhjT'></small><noframes id='4HhjT'>