how .NET  Framework is installed.

Posted on 2006-11-03
Last Modified: 2010-04-24

How can i check that .NET  Framework is installed before launching my .NET  Framework application from c++ code?

Question by:quali
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 12

Expert Comment

ID: 17865355
LVL 48

Expert Comment

ID: 17865816
You can test whether mscoree.dll exists in the %SystemRoot%\system32 directory.
To determine which .NET Framework versions are installed, enunerate keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy

Author Comment

ID: 17879649
>>You can test whether mscoree.dll exists in the %SystemRoot%\system32 directory.
how can i test it in c++ programme?
LVL 48

Accepted Solution

AlexFM earned 250 total points
ID: 17879796
BOOL FileExists(LPCTSTR sFileName)
    TCHAR name[1000];

    ExpandEnvironmentStrings(sFileName, name, 1000);

    DWORD dwResult = GetFileAttributes(name);

    if ( dwResult == 0xffffffff  ||
        return FALSE;

    return TRUE;

if ( FileExists(_T("%SystemRoot%\\system32\\mscoree.dll")))
    // exists

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
need some help with Editbox 11 115
Drive driver 2 117
64 bit versus 32 bit systems 2 140
looking for books on c++ and javascript 4 171
The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question