I have been playing around with Microsoft.Web.Administration and I have had the following code run in my settup:
{
using (ServerManager serverManager = new ServerManager())
{
foreach (Site site in serverManager.Sites)
{
site.Delete();
}
foreach (var applicationPool in serverManager.ApplicationPools)
{
applicationPool.Delete();
}
serverManager.CommitChanges();
}
}
Today I am not able, when create a new site in visual studio to start IIS Express.
I have uninstalled and installed it again with same results.
C:\Users\s093294>"C:\Program Files\IIS Express\iisexpress.exe" /trace:error Starting IIS Express ... Process Model Shutdown called Unable to start iisexpress.
The object identifier does not represent a valid object. For more information about the error, run iisexpress.exe with the tracing switch enabled (/trace:error).
C:\Users\s093294>
Any suggestions?
probably your applicationhost.config file (located in %userprofile%\documents\iisexpress\config) was corrupted. Take a backup of this applicationhost.config file and delete it and then re-create the site from visual studio. (IIS Express would recreate the config file)