SBFrancies
SBFrancies

Reputation: 4250

Deploying a ASP.Net Core web application via IIS

I am having trouble deploying a ASP.Net Core 2.0 web application via IIS. My application builds and runs through VS but I cannot get the IIS instance to work.

I get the following error message:

HTTP Error 502.5 - Process Failure 

Common causes of this issue: 

- The application process failed to start 
- The application process started but then stopped 
- The application process started but failed to listen on the configured port 

None of the troubleshooting steps have worked. I do not think the problem is with the application itself as when I run the following through command line:

"C:\Program Files\dotnet\dotnet.exe" C:\inetpub\wwwroot\MyApp\MyApp.dll

The application runs and I can view it at http://localhost:5000/

I have been through all the steps at https://learn.microsoft.com/en-gb/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore1x#common-errors and still have not made any progress.

This is what my WebHostBuilder method looks like:

var host = new WebHostBuilder()
              .UseKestrel()
              .UseContentRoot(Directory.GetCurrentDirectory())
              .UseIISIntegration()
              .UseStartup<Startup>()
              .UseApplicationInsights()
              .Build();
host.Run();

and I use the following settings in my Startup.cs:

services.Configure<IISOptions>(options =>
{
    options.AutomaticAuthentication = true;
});

Upvotes: 0

Views: 393

Answers (1)

Nick
Nick

Reputation: 1055

That error can be for a number of reasons.

  1. On you IIS server have you installed the .Net Core Runtime?
  2. Is your application pool configured correctly?
  3. Are your site bindings correct? enter image description here
  4. Check the install runtimes on your computer are the same you are trying to run on the projectenter image description here

Upvotes: 1

Related Questions