Gentlemen,
I have trouble operating the SolidCP with IIS8.5 and Windows Server 2012 R2, when trying to create a web site has the following error message:
[9/10/2016 5:30:37 PM] ERROR: ‘Internet Information Services 8.0’ SiteIdExists
System.Runtime.InteropServices.COMException (0x8007000D): Invalid site name
at Microsoft.Web.Administration.Interop.IAppHostProperty.set_Value(Object value)
at Microsoft.Web.Administration.ConfigurationElementCollectionBase`1.FindElementWithCollectionKey(String elementName, String collectionKey, Object value)
at Microsoft.Web.Administration.SiteCollection.get_Item(String name)
at SolidCP.Providers.Web.Iis.WebObjects.WebObjectsModuleService.SiteExists(ServerManager srvman, String siteId)
at SolidCP.Providers.Web.IIs70.SiteExists(String siteId)
at SolidCP.Server.WebServer.SiteExists(String siteId)
I appreciate any help.
Thank you
Hello,
Ok i checked the code and for IIS 7 / 8 it uses:
public override bool SiteExists(string siteId)
{
using (ServerManager srvman = webObjectsSvc.GetServerManager())
{
return webObjectsSvc.SiteExists(srvman, siteId);
}
}
While for IIS 6 it uses:
public virtual bool SiteExists(string siteId)
{
return (wmi.ExecuteQuery(
String.Format(“SELECT * FROM IIsWebServerSetting WHERE Name='{0}'”, siteId)).Count > 0);
}
for IIS 7/8:
The SideID is domain.com , and if it doesn’t exist it should return a null value
Nothing more to it.
For IIS 6:
public string GetSiteId(string siteName)
{
string siteId = null;
ManagementObjectCollection objSites = wmi.ExecuteQuery(
String.Format(“SELECT * FROM IIsWebServerSetting WHERE ServerComment='{0}'”, siteName));
foreach (ManagementObject objSite in objSites)
siteId = (string)objSite.Properties[”Name”].Value;
return siteId;
}
Which might need to be adjusted into your code?
as the siteID is simply handled different compared to IIS 6,