ASP.NET Core 1.1 runs fine locally but when publishing to Azure says “An error occurred while starting the application.”

前端 未结 10 1127
情话喂你
情话喂你 2020-12-01 02:42

I\'ve been developing an ASP.NET Core web app, based largely on the MVC template provided in Visual Studio 2017 RC2. It runs just fine in local debug mode, but when I try to

相关标签:
10条回答
  • 2020-12-01 03:27

    Connect via an sftp client and delete everything in the site/wwwroot folder manually. Republish

    I have had nothing but problems since I migrated an application I have hosted on Azure to .net core from MVC 4.

    At one point a few weeks ago I was unable to get a project to run after a successful publish. I even tried twice to delete the entire App Service profile and recreate it with the same name. However when I appended a '2' to the App Service name (to create a never before used app service) publishing the exact same project with 0 changes worked perfectly. What exactly does a delete do if I can publish successfully to a new app service but not a deleted and recreated one? Remove Existing Files At Destination was checked in each publish, that didn't do anything either.

    I had the same error today as pictured in the OP in my #2 site. It occurred after attempting to update a number of asp nuget packages and re-deploy. Really not wanting to have to move on to iteration myApp3 of my app service, I decided to use the FTP information provided in the azure overview page. I navigated to Site/wwwroot and deleted everything inside from the FTP client. I then published the application, and it worked. I can only conclude that the 'Delete' checkbox doesn't work properly.

    0 讨论(0)
  • 2020-12-01 03:27

    In my case there was a directory named Resources that was missing in app directory.

    0 讨论(0)
  • 2020-12-01 03:28

    Clean and rebuild fixed everything.

    0 讨论(0)
  • 2020-12-01 03:32

    I've got the same problem. Just not deployed at Azure, I'm using my local machine as server and host it in IIS.

    An error occurred while starting the application.
    
    .NET Core X64 v4.1.1.0    |   Microsoft.AspNetCore.Hosting version 1.1.1    |    Microsoft Windows 10.0.14393    |   Need help?
    

    And this was solved by changing web.config.

    First set stdoutLogEnabled = "true"

    Then make sure stdoutLogFile=".\logs\stdout" /> this folder exists.

    And then restart IIS, you can find the real problem in log file.

    0 讨论(0)
提交回复
热议问题