0

Can you tell me whether it is possible to change the .NetFramework version of another application using the dnlib library?

// Properties.Resources.MyExeFile - Binary file located in application resources
using var module = ModuleDefMD.Load(Properties.Resources.MyExeFile);
if (module.IsILOnly)
{
   module?.Write(Path.Combine(CurrDir, "Build.exe"));
}
r3xq1
  • 26
  • 4
  • 1
    It is possible, but you need to be more specific on from what version to what version. – Lex Li Sep 07 '20 at 23:04
  • @LexLi, 4.0 change to 4.5 version – r3xq1 Sep 07 '20 at 23:05
  • 1
    You might build a hello world project for both .NET Framework 4.0 and 4.5, then compare the assemblies to learn the changes required. At least you need to modify `TargetFrameworkAttribute` https://learn.microsoft.com/en-us/dotnet/api/system.runtime.versioning.targetframeworkattribute?view=netcore-3.1 but there might be other minor changes. – Lex Li Sep 07 '20 at 23:08
  • Why would you need to do this. – TheGeneral Sep 08 '20 at 02:01

0 Answers0