Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating the IIS site framework version
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Updating the IIS site framework version
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01446849
Message ID:
01446849
Views:
81
Hi Viv

Recently, we had a thread about using aspnet_regiis.exe to update an IIS site framework version. However, there are some concerns about security issues using that approach. So, in my quest to fully automate that process, I came up with this, which is a piece of code I found on the Internet and adjusted later to fit in my class:
                    loScriptMapVals = loNewRoot.Properties("ScriptMaps")

                    For Each lcScriptMapVal In loScriptMapVals

                        If lcScriptMapVal.IndexOf("Framework") > 0 Then

                            lcVersion = lcScriptMapVal.Substring(lcScriptMapVal.IndexOf("Framework") + 10, 9)
                            lcNewValue = lcScriptMapVal.Replace(lcVersion, cFrameworkVersion)

                            loScriptMaps.Add(lcNewValue)
                        Else
                            loScriptMaps.Add(lcScriptMapVal)
                        End If

                    Next

                    loNewRoot.Properties("ScriptMaps").Value = loScriptMaps.ToArray()
                    loNewRoot.CommitChanges()
                    loNewRoot.Invoke("SetInfo")

                    loNewRoot.CommitChanges()
Now, the beauty with this code is that this is instant. So, basically, I can create or update site in a flash. When I tag 10 records, from my site table, I can create 10 IIS sites in about .2 seconds.

I will have an article about this class I built later on in a series of articles on .NET in the next Universal Thread Magazine issue.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform