The specified CGI application encountered an error and the server terminated the process

后端 未结 11 1316
轮回少年
轮回少年 2020-11-28 12:32

I am hosting a asp.net 5 application on azure, the code is complied for beta8, the application runs fine on the local environment and when i publish the code on the azure si

11条回答
  •  失恋的感觉
    2020-11-28 13:12

    Short Answer

    For us the fix was to to UseIISIntegration() on the WebHostBuilder.

    public static void Main(string[] args)
    {
        var host = new WebHostBuilder()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseKestrel()
            .UseIISIntegration() // Necessary for Azure.
            .UseStartup()
            .Build();
    
         host.Run();
    }
    

    More Details

    Our web.config looks like this:

             
                                    
                                 
                                         
                   
                                        
              
                                
           
    

    Our project.json looks like this:

    {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0",
          "type": "platform"
        },
        "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0-*",
        "Microsoft.AspNetCore.Server.Kestrel": "1.1.0-*"
      },
      "tools": {
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
      },
      "frameworks": {
        "netcoreapp1.0": {}
      },
      "buildOptions": {
        "emitEntryPoint": true
      },
      "publishOptions": {
        "include": [
          "web.config"
        ]
      },
      "scripts": {
        "postpublish": [
          "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
        ]
      }
    }
    

    Our nuget.config looks like this:

    
    
      
        
        
      
    
    

提交回复
热议问题