RB.
RB.

Reputation: 37192

Running .NET app causes error requiring .NET 4.6.2, but app targets 4.6.1

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:

enter image description here

We have other .NET 4.6.1 applications running successfully on that server.

Server Details

Server is Windows Server 2012 R2.

The registry clearly demonstrates that .NET 4.6.1 is installed (as Release = 392471 as described here

enter image description here

Project file

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

Answers (1)

Andy
Andy

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

Related Questions