示例#1
0
 protected void Application_Start(object sender, EventArgs e)
 {
     var list = IISFactory.FindServices();
     foreach (var type in list.Distinct())
     {
         var factory = new IISFactory();
         RouteTable.Routes.Add(new ServiceRoute(type.FullName + ".svc", factory, type));
         RouteTable.Routes.Add(new ServiceRoute(type.Name, factory, type));
     }
     RouteTable.Routes.Add(new ServiceRoute("api-docs", new WebServiceHostFactory(), typeof(Discoverator)));
 }
示例#2
0
        private void ConfigWebSite()
        {
            IIIS iis = IISFactory.Create();

            if (iis.ExistApplicationPool(this.mApplicationPoolName))
            {
                iis.DeleteApplocationPool(this.mApplicationPoolName);
            }
            iis.CreateApplicationPool(this.mApplicationPoolName, this.mUsername, this.mPassword);
            if (iis.ExistWebSite(this.mWebSiteName))
            {
                iis.DeleteWebSite(this.mWebSiteName);
            }
            iis.CreateWebSite(this.mWebSiteName, this.mPort, this.mScheam, this.mInstallPath, this.mApplicationPoolName);
        }