locked
WebService Setup Project RRS feed

  • Question

  • User-538535113 posted

    Is it possible to deploy a webservice on IIS 7.5 & create it's virtual Directory -  by One Click Setup ? If Yes , How ?

    Monday, October 1, 2012 3:10 AM

All replies

  • Thursday, March 19, 2015 10:50 AM
  • User325378113 posted

    Do you mean programmatically? If so you can use the Microsoft.Web.Administration.ServerManager and Microsoft.Web.Administration.Application classes to manage your IIS installation. For example to create a virtual directory you would do something like:

    Microsoft.Web.Administration.ServerManager iisManager = new Microsoft.Web.Administration.ServerManager();
    Microsoft.Web.Administration.Application iisApp = iisManager.Sites[strSiteName].Applications["/"];
    VirtualDirectory myvDir = iisApp.VirtualDirectories.Add("/LocalUser/" + strUsername, strPath);
    myvDir.UserName = myCloud.Core.Config.csStorageUsername;
    myvDir.Password = myCloud.Core.Config.csStoragePassword;
    iisManager.CommitChanges();

    To make an existing folder an application folder use the ApplicationCollection under the serverManager.Sites[sitename].Applications call to create a new VirtualDirectoryCollection.

    Thursday, March 26, 2015 12:12 AM