{"id":2522,"date":"2017-07-27T09:43:30","date_gmt":"2017-07-27T07:43:30","guid":{"rendered":"http:\/\/mariusbancila.ro\/blog\/?p=2522"},"modified":"2017-07-27T09:47:55","modified_gmt":"2017-07-27T07:47:55","slug":"how-to-determine-what-clr-versions-are-installed-using-c","status":"publish","type":"post","link":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/","title":{"rendered":"How to determine what CLR versions are installed using C++"},"content":{"rendered":"<p>You may have multiple versions of the .NET framework installed and used on your machine. The framework has two components: the set of assemblies that provide functionalities for your application, and the common language runtime (CLR) that handles the execution of the application. These two components are versioned separately. If you what to see what versions of the framework are installed, you have to query the Windows Registry. If you want to know what versions of the CLR are installed you could either use <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/tools\/clrver-exe-clr-version-tool\" target=\"_blank\">clrver.exe<\/a> or do it programmatically. In this article, we will look at this later option and how to do it in C++.<\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/migration-guide\/how-to-determine-which-versions-are-installed\" target=\"_blank\">How to: Determine Which .NET Framework Versions Are Installed<\/a><\/p>\n<p>To query the installed CLR versions from C++ we have to:<\/p>\n<ul>\n<li>Create an instance of the <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/unmanaged-api\/hosting\/iclrmetahost-interface\" target=\"_blank\">ICLRMetaHost<\/a> COM interface, that provides functionality for enumerating installed and loaded runtimes, get a specific runtime and other runtime operations. For this purpose we have to use the <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/unmanaged-api\/hosting\/clrcreateinstance-function\" target=\"_blank\">CLRCreateInstance<\/a> function.<\/li>\n<li>Call <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/unmanaged-api\/hosting\/iclrmetahost-enumerateinstalledruntimes-method\" target=\"_blank\">ICLRMetaHost::EnumerateInstalledRuntimes<\/a> to get an object implementing the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms683764(v=vs.85).aspx\" target=\"_blank\">IEnumUnknown<\/a> COM interface that enables enumerating a collection of <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/unmanaged-api\/hosting\/iclrruntimeinfo-interface\" target=\"_blank\">ICLRRuntimeInfo<\/a> interface pointers.<\/li>\n<li>Call <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/framework\/unmanaged-api\/hosting\/iclrruntimeinfo-getversionstring-method\" target=\"_blank\">ICLRRuntimeInfo::GetVersionString<\/a> to get CLR version information.<\/li>\n<\/ul>\n<pre class=\"lang:c++ decode:true \" >#include &lt;string&gt;\r\n#include &lt;iostream&gt;\r\n\r\n#import &lt;mscorlib.tlb&gt; raw_interfaces_only rename( \"value\", \"value2\" ) rename( \"ReportEvent\", \"InteropServices_ReportEvent\" )\r\n\r\n#include &lt;metahost.h&gt;\r\n#pragma comment( lib, \"Mscoree\" )\r\n\r\n_COM_SMARTPTR_TYPEDEF(ICLRMetaHost, IID_ICLRMetaHost);\r\n_COM_SMARTPTR_TYPEDEF(ICLRRuntimeInfo, IID_ICLRRuntimeInfo);\r\n\r\nint main()\r\n{\r\n   ICLRMetaHostPtr pMetaHost{ nullptr };\r\n   HRESULT hr = CLRCreateInstance(CLSID_CLRMetaHost, IID_PPV_ARGS(&amp;pMetaHost));\r\n   if (FAILED(hr))\r\n      return -1;\r\n\r\n   IEnumUnknownPtr enumptr{ nullptr };\r\n   hr = pMetaHost-&gt;EnumerateInstalledRuntimes(&amp;enumptr);\r\n   if (FAILED(hr))\r\n      return -1;\r\n\r\n   while (true)\r\n   {\r\n      ULONG fetched{ 0 };\r\n      IUnknownPtr uptr{ nullptr };\r\n      hr = enumptr-&gt;Next(1, &amp;uptr, &amp;fetched);\r\n      if (hr == S_OK)\r\n      {\r\n         ICLRRuntimeInfoPtr crlri{ uptr };\r\n\r\n         DWORD size{ 0 };\r\n         hr = crlri-&gt;GetVersionString(nullptr, &amp;size);\r\n         if (hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) &amp;&amp; size &gt; 0)\r\n         {\r\n            std::wstring version(size, 0);\r\n            hr = crlri-&gt;GetVersionString(&amp;version.front(), &amp;size);\r\n            if (SUCCEEDED(hr))\r\n               std::wcout &lt;&lt; version &lt;&lt; std::endl;\r\n         }\r\n      }\r\n      else\r\n         break;\r\n   };\r\n\r\n   return 0;\r\n}<\/pre>\n<p>In order to call <tt>CLRCreateInstance<\/tt> we must include the <tt>metahost.h<\/tt> header and link with the <tt>Mscoree.lib<\/tt> static library.<\/p>\n<p>To use the <tt>ICLRMetaHost<\/tt> and <tt>ICLRRuntimeInfo<\/tt> interfaces we must import the <tt>mscorlib.tlb<\/tt> type library. The <tt>_COM_SMARTPTR_TYPEDEF<\/tt> are used for defining COM smart pointers <tt>ICLRMetaHostPtr<\/tt> and <tt>ICLRRuntimeInfoPtr<\/tt> that automatically handle the reference counter of the underlying COM object.<\/p>\n<p>The call to the <tt>EnumerateInstalledRuntimes<\/tt> method, when successful, returns a pointer to an <tt>IEnumUnknown<\/tt> interface. This enables enumerating through a component that contains multiple objects. Its method <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/windows\/desktop\/ms693367.aspx\" target=\"_blank\">Next<\/a> retrieves a specified number of items. In this implementation that number is 1. The return value is a pointer to the <tt>IUnknown<\/tt> interface, but what we are enumerating through are actually <tt>ICLRRuntimeInfo<\/tt> interfaces.<\/p>\n<p>To retrieve the version info we must use the <tt>GetVersionString<\/tt> method of <tt>ICLRRuntimeInfo<\/tt>. The arguments are an array of wide characters that will receive the string and the size of the array. In order to retrieve the necessary size of the buffer, we have to first call the method with <tt>null<\/tt> for the first argument. In this case the function returns <tt>ERROR_INSUFFICIENT_BUFFER<\/tt> as a <tt>HRESULT<\/tt> (i.e. <tt>HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)<\/tt>) and sets the second argument to the necessary size. After allocating the necessary buffer, we call the method again, providing the buffer and its size.<\/p>\n<p>Running this program on my machine prints the following (which is the same as the output from <tt>clrver.exe<\/tt>).<\/p>\n<pre>\r\nv2.0.50727\r\nv4.0.30319\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You may have multiple versions of the .NET framework installed and used on your machine. The framework has two components: the set of assemblies that provide functionalities for your application, and the common language runtime (CLR) that handles the execution of the application. These two components are versioned separately. If you what to see what &#8230; <a title=\"How to determine what CLR versions are installed using C++\" class=\"read-more\" href=\"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/\" aria-label=\"Read more about How to determine what CLR versions are installed using C++\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","advgb_blocks_editor_width":"","advgb_blocks_columns_visual_guide":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13,7,8],"tags":[454,451,518,292],"class_list":["post-2522","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-windows-programming","tag-net","tag-c","tag-clr","tag-runtime"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.3 - aioseo.com -->\n\t<meta name=\"description\" content=\"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Marius Bancila\"\/>\n\t<meta name=\"keywords\" content=\"c++,.net,clr,runtime\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.3\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Marius Bancila&#039;s Blog | About code. Mostly on C++\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to determine what CLR versions are installed using C++\" \/>\n\t\t<meta property=\"og:description\" content=\"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2017-07-27T07:43:30+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2017-07-27T07:47:55+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to determine what CLR versions are installed using C++\" \/>\n\t\t<meta name=\"twitter:description\" content=\"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#article\",\"name\":\"How to determine what CLR versions are installed using C++\",\"headline\":\"How to determine what CLR versions are installed using C++\",\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"},\"datePublished\":\"2017-07-27T09:43:30+02:00\",\"dateModified\":\"2017-07-27T09:47:55+02:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#webpage\"},\"articleSection\":\".NET, C++, Windows Programming, .NET, C++, CLR, runtime\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"position\":2,\"name\":\"IT\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"position\":3,\"name\":\"Software\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/#listItem\",\"name\":\"IT\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"position\":4,\"name\":\"C++\",\"item\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#listItem\",\"name\":\"How to determine what CLR versions are installed using C++\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/#listItem\",\"name\":\"Software\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#listItem\",\"position\":5,\"name\":\"How to determine what CLR versions are installed using C++\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/category\\\/it\\\/software\\\/c\\\/#listItem\",\"name\":\"C++\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/\",\"name\":\"Marius Bancila\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Marius Bancila\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#webpage\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/\",\"name\":\"How to determine what CLR versions are installed using C++\",\"description\":\"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/2017\\\/07\\\/27\\\/how-to-determine-what-clr-versions-are-installed-using-c\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2017-07-27T09:43:30+02:00\",\"dateModified\":\"2017-07-27T09:47:55+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/\",\"name\":\"Marius Bancila's Blog\",\"description\":\"About code. Mostly on C++\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/mariusbancila.ro\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to determine what CLR versions are installed using C++","description":"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.","canonical_url":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/","robots":"max-image-preview:large","keywords":"c++,.net,clr,runtime","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#article","name":"How to determine what CLR versions are installed using C++","headline":"How to determine what CLR versions are installed using C++","author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"},"datePublished":"2017-07-27T09:43:30+02:00","dateModified":"2017-07-27T09:47:55+02:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#webpage"},"isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#webpage"},"articleSection":".NET, C++, Windows Programming, .NET, C++, CLR, runtime"},{"@type":"BreadcrumbList","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/mariusbancila.ro\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","position":2,"name":"IT","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","position":3,"name":"Software","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/#listItem","name":"IT"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","position":4,"name":"C++","item":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/","nextItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#listItem","name":"How to determine what CLR versions are installed using C++"},"previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/#listItem","name":"Software"}},{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#listItem","position":5,"name":"How to determine what CLR versions are installed using C++","previousItem":{"@type":"ListItem","@id":"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/#listItem","name":"C++"}}]},{"@type":"Organization","@id":"https:\/\/mariusbancila.ro\/blog\/#organization","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","url":"https:\/\/mariusbancila.ro\/blog\/"},{"@type":"Person","@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author","url":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/","name":"Marius Bancila","image":{"@type":"ImageObject","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/a84dd2831d955c38355ddea55df4df260809b88f36408bc14fd4eab8f7f131c9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Marius Bancila"}},{"@type":"WebPage","@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#webpage","url":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/","name":"How to determine what CLR versions are installed using C++","description":"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/mariusbancila.ro\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/#breadcrumblist"},"author":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"creator":{"@id":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/#author"},"datePublished":"2017-07-27T09:43:30+02:00","dateModified":"2017-07-27T09:47:55+02:00"},{"@type":"WebSite","@id":"https:\/\/mariusbancila.ro\/blog\/#website","url":"https:\/\/mariusbancila.ro\/blog\/","name":"Marius Bancila's Blog","description":"About code. Mostly on C++","inLanguage":"en-US","publisher":{"@id":"https:\/\/mariusbancila.ro\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Marius Bancila's Blog | About code. Mostly on C++","og:type":"article","og:title":"How to determine what CLR versions are installed using C++","og:description":"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.","og:url":"https:\/\/mariusbancila.ro\/blog\/2017\/07\/27\/how-to-determine-what-clr-versions-are-installed-using-c\/","article:published_time":"2017-07-27T07:43:30+00:00","article:modified_time":"2017-07-27T07:47:55+00:00","twitter:card":"summary","twitter:title":"How to determine what CLR versions are installed using C++","twitter:description":"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine."},"aioseo_meta_data":{"post_id":"2522","title":"How to determine what CLR versions are installed using C++","description":"A tutorial for programmatically determining from C++ what versions of the CLR are installed on a machine.","keywords":[{"label":"C++","value":"C++"},{"label":".NET","value":".NET"},{"label":"CLR","value":"CLR"},{"label":"runtime","value":"runtime"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-18 21:06:01","updated":"2025-12-12 07:46:59","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"author_meta":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"featured_img":null,"jetpack_publicize_connections":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Marius Bancila","author_link":"https:\/\/mariusbancila.ro\/blog\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"You may have multiple versions of the .NET framework installed and used on your machine. The framework has two components: the set of assemblies that provide functionalities for your application, and the common language runtime (CLR) that handles the execution of the application. These two components are versioned separately. If you what to see what&hellip;","coauthors":[],"tax_additional":{"categories":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/net\/\" class=\"advgb-post-tax-term\">.NET<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/c\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">Windows Programming<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">.NET<\/span>","<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">Windows Programming<\/span>"]},"tags":{"linked":["<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">.NET<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">C++<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">CLR<\/a>","<a href=\"https:\/\/mariusbancila.ro\/blog\/category\/it\/software\/windows-programming\/\" class=\"advgb-post-tax-term\">runtime<\/a>"],"unlinked":["<span class=\"advgb-post-tax-term\">.NET<\/span>","<span class=\"advgb-post-tax-term\">C++<\/span>","<span class=\"advgb-post-tax-term\">CLR<\/span>","<span class=\"advgb-post-tax-term\">runtime<\/span>"]}},"comment_count":"0","relative_dates":{"created":"Posted 9 years ago","modified":"Updated 9 years ago"},"absolute_dates":{"created":"Posted on July 27, 2017","modified":"Updated on July 27, 2017"},"absolute_dates_time":{"created":"Posted on July 27, 2017 9:43 am","modified":"Updated on July 27, 2017 9:47 am"},"featured_img_caption":"","series_order":"","jetpack_shortlink":"https:\/\/wp.me\/pYNdv-EG","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/2522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/comments?post=2522"}],"version-history":[{"count":8,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/2522\/revisions"}],"predecessor-version":[{"id":2530,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/posts\/2522\/revisions\/2530"}],"wp:attachment":[{"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/media?parent=2522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/categories?post=2522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mariusbancila.ro\/blog\/wp-json\/wp\/v2\/tags?post=2522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}