When I use:
System.Environment.Version
The result is "2.0.50727.3053"
I know that 3.5 is compatible and in IIS is identified as 2.0, blah blah...
I would like to know the exact .net version installed and if another resources are installed, like ASP.NET MVC, etc. The problem is that the website is installed in a shared hosting, so I can ask about that resouces to tech support, but if I know programatically, its far better.
Regards
NET 3.5 is installed by looking at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3. 5\Install, which is a DWORD value. If that value is present and set to 1, then that version of the Framework is installed. Look at HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.
During design time go to “Solution Explorer." Right click on it and expand the “References” folder. Right click on “Web. MVC” Assembly. Then select “Properties” and you can find the versions.
From PowerShell: Launch PowerShell as an administrator. Run the command import-module servermanager. ASP.NET 4.5: Run the command get-windowsfeature Net-Framework-45-Core. The output indicates the ASP.NET 4.5 install state ("Installed" or "Available").
Not sure but try something like this:
bool mvcInstalled = true;
try
{
System.Reflection.Assembly.ReflectionOnlyLoad(
"System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35");
}
catch()
{
mvcInstalled = false;
}
UPDATED:
To know if .NET 3.5 SP1 is installed check for System.Web.Abstractions assembly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With