.net - 如何定位特定的 .NET 核心版本
问题描述
在我的开发机器上,我安装了 .NET core 5.0.5、5.0.6 和 5.07 托管包。在我的产品机器上,我有 .NET core 5.0.5
在我的 .csproj 文件中,我有:
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RuntimeFrameworkVersion>5.0.5</RuntimeFrameworkVersion>
<Version>1.0.0</Version>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<OutputType>WinExe</OutputType>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
</PropertyGroup>
我使用 VS2019 构建。
部署到生产后,我在事件查看器中得到以下信息:
Could not find 'aspnetcorev2_inprocess.dll'. Exception message:
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '5.0.7' was not found.
- The following frameworks were found:
2.1.15 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
3.1.1 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
5.0.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
显然我不想使用 5.0.7 我做错了什么?
解决方案
错误在 .NET5 中得到确认,据说在 .NET6 中已修复 https://github.com/dotnet/aspnetcore/issues/33941
推荐阅读
- mongodb - removeShard 命令会清除该分片上的数据吗?
- docker - 使用 Semver 为 AWS ECS 托管的 docker 映像部署
- django - 当另一个登录失败发生时,Django 轴重置冷却
- kubernetes - Kubernetes 的 Traefik ingressRoute。如何将443端口重定向到8082端口?
- python-3.x - sqlite 选择具有特定 id 的所有值
- php - 使用 php 从两个表中识别条目
- xml - XSLT 具有嵌套的 for-each-group 以显示同级元素的唯一组合
- java - 在Java中选择类似于CEFBrowser的“runFileDialog”的文件夹
- mysql - 来自 GUI 的存储过程调用给出结果集,存储过程的查询返回空结果集
- reactjs - 窗口底部的 MUI 手风琴