-1

I have a C# WinForms application, using the Visual Studio 2019 Setup template to create a setup. The app is a created for .NET 4.6.2 and the framework prerequisites and launch condition in the setup project are also 4.6.2. This setup worked for years. I test every update on a fresh Win10 installation with the latest updates.

For some time (~2 or 3 months) now, the following happens. The setup runs as expected and installs the app without any problems. But now, when I start the exe after the setup has finished, the .NET 3.5 framework is downloaded automatically. This never happened before and as a side effect my app is locked in the task manager after the 3.5 download and installation is completed.

As the setup is always the same, only the exe changes and sometimes newer versions of some 3rd party DLLs are added, I think that something must have changed on the Windows side (maybe 3.5 is not present anymore with the latest Win10 versions).

But the question for me is: How can I identify which component or DLL demands the 3.5 framework?

Is there any free software available that I can use to check my project for 3.5 dependencies?

Thanks!

Igotcha
  • 317
  • 1
  • 14

1 Answers1

1

Aside from looking at the documentation for each DLL, you may be able to use some methods from System.Reflection. However, here's a non-programmatic way to see what version of .NET is being used by a .NET DLL.

Note: SDKs can be found in %ProgramFiles(x86)%\Microsoft SDKs\Windows\ (ex: C:\Program Files (x86)\Microsoft SDKs\Windows)

We'll use ildasm.exe which can be found in one or more of the following locations (given that the SDK was installed in the default location):

Win 10:

  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\x64
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.2 Tools\x64 ...

Win 8.1:

  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64

Win 7:

  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\
  • `%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\x64

Run ildasm.exe

  • Double-click ildasm.exe to run it (or open a cmd window and type ildasm.exe)
  • Click File
  • Select Open
  • Choose your DLL file (ex: TestDLL35.dll)
  • Double-click MANIFEST to open it in a new window

You'll see something like the following:

ildasm - manifest

When you see: .assembly extern <name> (ex: .assembly extern mscorlib or .assembly extern System.Xml.Linq), look for .ver inside the curly brackets. This is the .NET version for that library (ex: 3:5:0:0)

ildasm - System.Xml.Linq

Resources:

Tu deschizi eu inchid
  • 4,117
  • 3
  • 13
  • 24