{"id":271,"date":"2011-07-29T12:09:10","date_gmt":"2011-07-29T12:09:10","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=271"},"modified":"2011-07-29T12:09:10","modified_gmt":"2011-07-29T12:09:10","slug":"how-to-verify-net-framework-version","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=271","title":{"rendered":"How To Verify .Net Framework Version"},"content":{"rendered":"<p>The .Net Framework is Microsoft promise of \u201ccompile once and run everywhere\u201d programming approach. Conceptually, the .Net Framework is similar to Java \u201cwrite once run everywhere (WORE)\u201d language on JVM, where the interoperability programming feature being one of the vital functionality.<\/p>\n<p>Since Microsoft introduces .Net Framework 1.0 as an optional upgrade on Nov 2000, the latest stable release of .Net Framework 4.0 has been the mandatory component of all Windows Vista and Windows Server 2008 (Longhorn) Operating systems!<br \/>\n<strong><\/strong><\/p>\n<p><strong>How to identify, check, detect or verify the Microsoft .Net Framework version installed on a computer?<\/strong><\/p>\n<p>There are at least two ways to verify Microsoft .Net Framework version, by Internet Explorer User Agent String or by compiling a .Net program to read the <strong>Environment.Version<\/strong> property of System namespace.<\/p>\n<p><strong>Reading the Environment.Version property of System namespace.<\/strong><\/p>\n<p>If you\u2019re keen on .Net programming, compile either one of these .Net program source code samples that retrieve Environment.Version property to identify .Net Framework version:<\/p>\n<p>C# source code to identify .Net Framework version:<\/p>\n<p>Save this C# source code as DotNetVer.cs and compile it with C# command line compiler, i.e. csc DotNetVer.cs<\/p>\n<blockquote>\n<pre>using System;<\/pre>\n<p style=\"text-align: left;\">class Version<br \/>\n{<br \/>\npublic static void Main()<br \/>\n{<br \/>\nConsole.WriteLine();<br \/>\nConsole.WriteLine(&#8220;.Net Framework Version {0}&#8221;,<br \/>\nEnvironment.Version.ToString());<br \/>\n}<br \/>\n}<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\">You can download this compiled program <a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2011\/07\/dotnetver.exe\">dotnetver<\/a>.<\/p>\n<p style=\"text-align: left;\">Put it on c: and launch command dos line<\/p>\n<blockquote>\n<p style=\"text-align: left;\">dotnetver.exe<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\">How to compile with c# via a batch file.<\/p>\n<p style=\"text-align: left;\"><!--more-->Create this batch file named csharp.bat on c:<\/p>\n<blockquote>\n<p style=\"text-align: left;\">cd C:WINDOWSMicrosoft.NETFrameworkv2.0.50727<br \/>\ncsc \/out:c:csharp%1.exe c:csharp%1.cs<br \/>\ncd<br \/>\necho &#8220;Done &#8230;&#8221;<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\">this script will take source code file from c:csharp like that :<\/p>\n<blockquote>\n<p style=\"text-align: left;\">c:csharp dotnetver (without .cs)<\/p>\n<\/blockquote>\n<p style=\"text-align: left;\">You can find from msdn<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/2fdbz5xd%28v=vs.71%29.aspx\" target=\"_blank\"> C# compilations instructions<\/a><\/p>\n<p style=\"text-align: left;\">You can find from msdn<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/s4kbxexc%28v=VS.71%29.aspx\" target=\"_blank\"> VB.NET compilations instructions<\/a><\/p>\n<p style=\"text-align: left;\">Enjoy it &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The .Net Framework is Microsoft promise of \u201ccompile once and run everywhere\u201d programming approach. Conceptually, the .Net Framework is similar to Java \u201cwrite once run everywhere (WORE)\u201d language on JVM, where the interoperability programming&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2841,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[37,45],"youtube_video":null,"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/271"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/271\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2841"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}