我有一个奇怪的错误。我有一个针对.NET 4.6.1构建的应用程序。但是,当我在服务器上运行它时,它抱怨它需要.NET 4.6.2,并带有以下对话框:
我们已在该服务器上成功运行其他.NET 4.6.1应用程序。
服务器是Windows Server 2012 R2。
注册表清楚地表明安装了.NET 4.6.1(正如所述here所述的Release = 392471
以下是EXE的ILSpy反汇编:
// {HIDDEN}.exe
// {HIDDEN}, Version=1.0.17725.11651, Culture=neutral, PublicKeyToken=null
// Global type: <Module>
// Entry point: {HIDDEN}.Program.Main
// Architecture: AnyCPU (64-bit preferred)
// Runtime: .NET 4.0
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
[assembly: AssemblyVersion("1.0.17725.11651")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("{HIDDEN}")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("© {HIDDEN}")]
[assembly: AssemblyDescription("{HIDDEN}")]
[assembly: AssemblyFileVersion("1.0.17725.11651")]
[assembly: AssemblyInformationalVersion("1.0.17725.11651")]
[assembly: AssemblyProduct("{HIDDEN})]
[assembly: AssemblyTitle("{HIDDEN}")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = ".NET Framework 4.6.1")]
从项目文件
<TargetFramework>net461</TargetFramework>
我没有想法并寻求帮助!
答案 0 :(得分:2)
检查您的app.config文件。你可能会有这样的东西。将其更改为4.6.1或将其删除。
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>