本文介绍了Visual Studio 2019 显示 .NET 5 Preview 8 的黄色感叹号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了 .NET 5 Preview 8 并在 Visual Studio 2019 16.8 Preview 2 中创建了一个新的 ASP.NET Core MVC 项目.

对于所有 NuGet 包,它显示黄色感叹号.没有编译错误,没有警告.该应用程序运行良好.没有错误.但是VS一直显示黄色感叹号.此问题仅适用于 .NET 5 项目.ASP.NET Core 3.1 项目不会出现这个问题.

我的项目文件如下所示:

<属性组><TargetFramework>net5.0</TargetFramework></PropertyGroup><项目组><PackageReference Include=Microsoft.AspNetCore.Mvc.NewtonsoftJson"版本=5.0.0-preview.8.20414.8"/><PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer";版本=5.0.0-preview.8.20407.4";/></项目组></项目>

是什么原因,如何解决??

谢谢.

解决方案

这是一个 .NET 5 Preview 8 中的已知问题:

  1. 解决方案资源管理器中依赖项节点中的警告图标

  • 对于面向 .NET 5 的项目,可能会在解决方案资源管理器依赖项节点中列出的包上显示警告图标

我认为目前没有可用的修复方法.

I recently installed .NET 5 Preview 8 and created a new ASP.NET Core MVC project in Visual Studio 2019 16.8 Preview 2.

For all the NuGet packages it is showing yellow exclamation mark. There are no compilation errors, no warnings. The application works fine. No errors. But VS keeps showing yellow exclamation. This problem comes only for .NET 5 projects. ASP.NET Core 3.1 projects don't give this problem.

My project file is shown below :

<Project Sdk="Microsoft.NET.Sdk.Web"> 
<PropertyGroup> 
<TargetFramework>net5.0</TargetFramework> 
</PropertyGroup> 
<ItemGroup> 
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.0-preview.8.20414.8" /> 
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0-preview.8.20407.4" /> 
</ItemGroup> 
</Project>

What's the reason and how to fix it ??

Thank you.

解决方案

It's a known issue in .NET 5 Preview 8:

I don't think there's a fix available at the moment.

这篇关于Visual Studio 2019 显示 .NET 5 Preview 8 的黄色感叹号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-24 19:08