asp.net-core - 构建错误 - 命名空间“Microsoft”中不存在类型或命名空间名称“AspNetCore”(您是否缺少程序集引用?
问题描述
我刚刚打开了一个前几天运行良好的项目。没有对代码进行任何更改,但是现在当我打开它时出现错误
命名空间“Microsoft”中不存在类型或命名空间名称“AspNetCore”(您是否缺少程序集引用?
唯一改变的是VS升级到16.5
我该如何解决?软件包都在那里,Nuget 报告一切都已安装。我已尝试卸载软件包并重新安装它们,但仍然出现错误。
这是我的 .csproj 文件
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.2" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.1" />
</ItemGroup>
</Project>
解决方案
推荐阅读
- javascript - 在年份之间添加每周日期
- lets-encrypt - 设置 nginx-proxy 时运行 acme-companion 出现问题
- python - 在容器中使用时,MLFlow 无法将我的工件正确复制到 mlruns 文件夹
- c++ - 这两个结构声明有什么区别?
- django - 如何在 django 中修复 Page not found 404?
- python - 如何使用openpyxl删除本地范围命名范围
- c# - C# 接口向下转换
- arrays - 有没有办法计算在插值搜索算法的数组中查找值所需的时间?
- r - bvpsolve - 微分方程系统
- algorithm - 如何在具有因变量的嵌套循环中查找操作数?