Reputation: 37192
I have a weird error. I have an application built against .NET 4.6.1. However, when I run it on the server, it complains that it requires .NET 4.6.2, with the following dialog:
We have other .NET 4.6.1 applications running successfully on that server.
Server is Windows Server 2012 R2.
The registry clearly demonstrates that .NET 4.6.1 is installed (as Release = 392471 as described here
Here is the ILSpy disassembly of the EXE:
// {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")]
And from the project file
<TargetFramework>net461</TargetFramework>
I'm out of ideas and looking for help!
Upvotes: 0
Views: 690
Reputation: 561
Check your app.config file. You may have something like this in it. Change it to 4.6.1 or remove it.
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
Upvotes: 2