1
Good,
I have the following code:
private void AspNet35()
{
String sWebSite = "W3SVC/1";
DirectoryEntry site = new DirectoryEntry("IIS://localhost/" + sWebSite + @"/Root");
try
{
PropertyValueCollection vals = site.Properties["ScriptMaps"];
foreach (string val in vals)
{
if (val.StartsWith(".aspx"))
{
string version = val.Substring(val.IndexOf("Framework") + 10, 9);
if (version == "3.5")
{
MessageBox.Show(String.Format("ASP.Net Version on virtual server is {0}", version));
}
}
}
}
catch
{
}
}
The idea was to check if IIS has Asp.net 3.5 installed. Or at least check wanted the installed versions.
How can I do it?
Thank you
You didn’t ask any questions
– Daniel Santos
The question was how do I know if Asp.net 3.5 is installed using c#? tried with the above code but it didn’t work.
– Bruno Santos
I have withdrawn -1 now that the question is clear
– Daniel Santos