c# - .csproj 文件在构建解决方案时自动更改?
问题描述
由于各种实体框架版本不兼容,我无法搭建 Razor 页面,因此我安装了所有版本 5.0.x 并更新了 .csproj 文件。但是当我构建解决方案时,它会变回以前的版本。
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Content Remove="Views\Logsign\signup.cshtml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.15" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.15">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.5" />
</ItemGroup>
</Project>
解决方案
您是否将 TargetFramework 更改为 5.0?
<PropertyGroup>
<TargetFramework>netcoreapp5.0</TargetFramework>
</PropertyGroup>
推荐阅读
- android - 准备好后如何显示 Glide 图像?如果没有完全下载,它们会显示不正确
- javascript - nodejs objects 属性只能更改为 int 而不是 string
- powershell - 用于检查正在运行的浏览器的 PowerShell 脚本
- mongodb - 无法连接到 VPS 上的 MongoDB
- python - Django 3.0.8 'bootstrap' 不是注册标签库。必须是以下之一:
- mysql - MySQL/MariaDB:创建数据透视表视图
- sql - SQL JSON_VALUE / JSON_QUERY 来自数组并转置为行
- c# - 使用泛型列表时无法编译
在 C# 中 - pandas - 如果数据框中的一个值是 NaN,则检查 pandas 并将其替换为 0
- python-3.x - 如何将授权标头添加到请求中,以便在标头上存在访问令牌时可以访问带有 @jwt_required 的烧瓶路由