c# - VS 强制更新到 2.1.4 后,.net core-mvc 应用程序将不会以 2.1.3 为目标

标签 c# asp.net-core-mvc

我在 .net core framework 2.1.4 发布之前开始开发一个新网站,我们的生产环境都设置了“即将推出”页面等。

由于此服务器托管其他站点,我们不想重新启动以升级到 2.1.4,因此我更新了 csproj 文件

    <RuntimeFrameworkVersion>2.1.3</RuntimeFrameworkVersion>

我还检查了 Microsoft.NETCore.App 的 NuGet 包,它设置为 2.1.3

然而,当我发布站点并将其复制到主机上的文件夹时,它仍然会记录

It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.1.4' was not found. - Check application dependencies and target a framework version installed at: "PATH" - Installing .NET Core prerequisites might help resolve this problem: http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409 - The .NET Core framework and SDK can be installed from: https://aka.ms/dotnet-download - The following versions are installed: 1.0.4 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 1.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 2.1.2 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] 2.1.3 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

我不知所措,如何将此项目更改为目标 2.1.3 而不是 2.1.4??

CS项目:

    <Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeFrameworkVersion>2.1.3</RuntimeFrameworkVersion>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.3" />
    <PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
    <PackageReference Include="System.Linq.Dynamic.Core" Version="1.0.8.18" />
  </ItemGroup>

</Project>

VS中Nuget依赖的截图: Screenshot of Dependencies in VS

最佳答案

在尝试降级 2 天后,我决定在客户下类时间继续将 2.1.4 部署到生产服务器,我知道这在技术上不是“答案”,但这是我可以解决的唯一方法需要部署的 4 天时间窗口内的问题。

关于c# - VS 强制更新到 2.1.4 后,.net core-mvc 应用程序将不会以 2.1.3 为目标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52449950/

相关文章:

c# - asp.net网站上使用ActiveMQ的例子

c# - while循环中的HttpClient只执行一次

c# - 如何在 ASP.NET Core MVC 中获取文件的最后修改日期?

asp.net - 发布 ASP.NET core 应用程序 : The command "npm install" exited with code 9009

c# - .NET 核心 : How to get a `Controller` instance (or just it's full name) from ViewLocationExpanderContext

authorization - 使用策略要求授权属性抛出 : The following authentication scheme was not accepted

c# - 与 COM 引用(版本 1.0 类型库)和 VS 2010 相关的生成警告

c# - 为什么从数据集中使用绑定(bind)源向 datagridview 添加数据是空白的?

C# - 时间格式的 DateTimePicker 在切换到下一个框时不关注小时值

javascript - jQuery Datatable - 来自 ajax 调用的错误消息