Deploying .net core application on live dedicated server

Shahzaib Khan 1 Reputation point
2021-04-09T14:35:51.73+00:00

Hi there,

I have developed a web application in ASP .net core and I have a windows dedicated server for it now I want to deploy the application there but unable to figure it out.
I have deployed some ASP.net applications there but for .net core when I upload the published project I get a 500 error.
Please guide me thoroughly about the process.

Thank you

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,170 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,275 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 48,576 Reputation points
    2021-04-09T14:54:02.94+00:00

    500 is a server error. Without knowing what the actual exception is there isn't much we're going to be able to do.

    MS has documented how to get ASP.NET Core apps running on an IIS server here. You need to walk through this process and make sure you've done everything properly. For the most part ASP.NET Core works just like ASP.NET but you must ensure that you've installed the ASP.NET Core runtime on the server. That is covered here. The important parts are that you need to install either the Hosted Bundle (which sets up IIS) or the full runtime (so you can run non-web apps as well) AND you must follow the directions for restarting IIS properly otherwise nothing works.

    After you've done all that, and following the documentation as given earlier, then everything else is like a regular ASP.NET app, you set up an app pool, create a web app pointed to your site's directory and ensure all the files were deployed properly. The site should work. Note that IIS doesn't understand ASP.NET so some of the configuration you'll do in your appsettings.json (or environment specific file) while others will be done in the auto-generated web.config needed by IIS. Also note that you for non-prod environments you should set the environment variable DOTNET_ENVIRONMENT and/or ASPNETCORE_ENVIRONMENT so the environment features of .NET Core work. You need to do this as a system env variable and therefore it won't take effect until you restart IIS or reboot the server.

    0 comments No comments