none
Installed .NET applications and their target frameworks RRS feed

  • Question

  • Hello, 

    I want to know if there is a way to get all installed .NET applications and their target frameworks on a computer. I have been able to query all installed applications using WMI, VBScript and PowerShell but I can’t find a way to detect the runtime or target framework version they are using. The results do not contain the path to the executables which I need to detect the runtime/target. 

    I was able to use CorsFlags.exe and reflection to get the runtimes of all exes recursively starting from the C drive but it spits out all applications not the ones installed.

    Is there a script/tool for this? Any help/recommendation will be appreciated. 

    Thank you! 

    JP
    Thursday, August 24, 2017 9:54 PM

Answers

  • Hi JP Larach,

    Why do you need this kind of function? Each app will set their required .NET Framework version in their setup. For security, the suggestions is only for your own app. 

    >>I need a tool/script that can scan the computer and tell me the runtimes just for installed .NET applications.

    You could use Windbg to get the .net framework version of .exe.

    You could download Windbg from the following lionk.

    https://developer.microsoft.com/en-us/windows/hardware/download-windbg

    For the command of Windbg, you would like to check the following link.

    https://stackoverflow.com/questions/7786949/get-the-net-framework-version-from-a-process-dump

    Based on my search, I do not find the application which do what you want directly.

    You could create a project. Using Process.GetProcesses Method () to get all processes running on the local computer.

    And then connect to the tools you used to get the .net framework version like powershell and so on with parameter of processes.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, September 5, 2017 6:08 AM
    Moderator

All replies

  • Hi JP Larach,

    Thank you for posting here.

    You could do this by using ILDASM and looking at the "MANIFEST" node or Reflector and looking at the dissasembly view of the "Application.exe" node as IL. In both cases there is a comment that indicates the CLR version. In ILDASM, the comment is "// Metadata version" and in Reflector the comment is "Target Runtime Version". 

    You would like to check the following link. It shows the examples of three ways.

    https://stackoverflow.com/questions/325918/how-to-find-out-which-version-of-the-net-framework-an-executable-needs-to-run

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, August 28, 2017 2:29 AM
    Moderator
  • Hello Wendy,

    Thank you for your reply!

    I saw that thread before and all those tools work for me but it is kind of a manual process using them. For Dotpeek you have to have the .exe running, for Corsflags you have to supply the path in command line and for ILDASM/ILSpy you have to manually search for the .exe. I need a tool/script that can scan the computer and tell me the runtimes just for installed .NET applications. I have been trying to do a PowerShell/VBScript to do this but I have not been successful at all. Please let me know if you have any guidance or clues on how to do this.

    Thank you!

    JP

    Tuesday, August 29, 2017 4:55 AM
  • Hi JP Larach,

    Why do you need this kind of function? Each app will set their required .NET Framework version in their setup. For security, the suggestions is only for your own app. 

    >>I need a tool/script that can scan the computer and tell me the runtimes just for installed .NET applications.

    You could use Windbg to get the .net framework version of .exe.

    You could download Windbg from the following lionk.

    https://developer.microsoft.com/en-us/windows/hardware/download-windbg

    For the command of Windbg, you would like to check the following link.

    https://stackoverflow.com/questions/7786949/get-the-net-framework-version-from-a-process-dump

    Based on my search, I do not find the application which do what you want directly.

    You could create a project. Using Process.GetProcesses Method () to get all processes running on the local computer.

    And then connect to the tools you used to get the .net framework version like powershell and so on with parameter of processes.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Tuesday, September 5, 2017 6:08 AM
    Moderator
  • AFAIK there is no official way to do so, but you may leverage Installer's scripting function to search  "'SELECT * FROM `_VsdLaunchCondition`" (from "Is there a Component table in the database" to "process component table" part, with the table name changed from Component to _VsdLaunchCondition) and check for "VSDFXAvailable", then search the Description field (I.e.: message string) between ".NET framework version " and the next space.

    The installer files of installed packages can be found at "%windir%\Installer" (the folder is hidden)

    Yes this is clumsy but that's the best I can think of now.






    • Edited by cheong00Editor Tuesday, September 5, 2017 2:57 PM Change the reply a bit so the method no longer require installer SDK
    Tuesday, September 5, 2017 8:07 AM
    Answerer
  • Hello Wendy,

    Yeah I think that would be the best option from what I see. I made a project, got all running processes and used reflection to get the target assembly.

    Thank you for your help!

    JP

    Tuesday, September 5, 2017 11:30 PM