Create ASP.NET APP on c# code

Discussion in 'General troubleshooting' started by rodrigoklang, Jun 11, 2013.

  1. Hi,

    I have this code to create a ASP.NET APP on ISS, i don't know if that way work with the ISS on Winhost:

    Code:
                    // Cria a pasta do site
                    if (!Directory.Exists(diretorio))
                        Directory.CreateDirectory(diretorio);
    
    
                    // Servidor de Aplicação
                    ServerManager sm = new ServerManager();
    
    
                    // Captura o site raiz onde irá adicionar a aplicação
                    Site st = sm.Sites["Default Web Site"];
    
    
                    // Cria a aplicação no diretório criado apontando o caminho, ex: aplicacao
                    Application app = st.Applications.Add("/aplicacao", diretorio);
                    app.ApplicationPoolName = "ASP.NET v4.0";
                    sm.CommitChanges();
    
                    // Libera
                    sm.Dispose();
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    I don't think this will work. You will need to convert your code to English.
     

Share This Page