更改为< TargetFrameworks>时出错. (复数).NET Core csproj文件中 [英] Error when changing to <TargetFrameworks> (plural) in .NET Core csproj file

查看:750
本文介绍了更改为< TargetFrameworks>时出错. (复数).NET Core csproj文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注有关Pluralsight的教程,该教程涉及同时针对.net核心2.2和.NET 4.7.2的MSTest项目.这需要转到我的测试项目的.csproj文件并对其进行编辑,以便进行以下操作:

I was following a tutorial on Pluralsight about having an MSTest project target both .net core 2.2 AND .NET 4.7.2. This required going to my .csproj file for my test project and editing it so that the following:

 <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    ...

将更改为TargetFramework s (现在是复数),然后我们添加.NET 4.7.2名称,如下所示:

would change to become TargetFrameworks (that's plural now) and then we add in the .NET 4.7.2 moniker, as follows:

 <PropertyGroup>
    <TargetFrameworks>netcoreapp2.2;net472</TargetFrameworks>
    ...

我保存了.csproj文件后,VS 2019在顶部的黄色栏中显示了以下错误:

As soon as I saved the .csproj file, VS 2019 showed the following error in a yellow bar at the top:

项目在上一次操作中遇到问题: 的"TargetFrameworkMoniker"和"NuGetTargetMoniker"属性 "Debug | AnyCPU"配置均为空.这个配置 不会有助于NuGet还原,这可能会导致还原和 建立错误.

The project ran into a problem during the last operation: The value of the 'TargetFrameworkMoniker' and 'NuGetTargetMoniker' properties in the 'Debug|AnyCPU' configuration are both empty. This configuration will not contribute to NuGet restore, which may result in restore and build errors.

我在做什么错了?

推荐答案

对我来说,当我关闭Visual Studio并再次打开解决方案时,错误消失了

For me, the error went away when I closed Visual Studio and opened the solution again

这篇关于更改为&lt; TargetFrameworks&gt;时出错. (复数).NET Core csproj文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆