0

I try to create a site problematically.

My code :

ServerManager serverMgr = new ServerManager();

protected void btnCreateSite_Click(object sender, EventArgs e)
{

    Site mySite = serverMgr.Sites.Add("MySiteName6", "C:\\inetpub\\wwwroot", 8070);
    serverMgr.ApplicationPools.Add("MyAppPool5");
    mySite.ApplicationDefaults.ApplicationPoolName = "MyAppPool";
    mySite.TraceFailedRequestsLogging.Enabled = true;
    mySite.TraceFailedRequestsLogging.Directory = "C:\\inetpub\\customfolder\\site";

    serverMgr.CommitChanges();
}

But when I open IIS I am not seeing MySiteName6. When I try to run http://localhost:8070 its not exist.

I am unable to understand where the site is gone? Am I in wrong direction.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
4b0
  • 21,981
  • 30
  • 95
  • 142

0 Answers0