question

ShahzaibKhan-7927 avatar image
0 Votes"
ShahzaibKhan-7927 asked erinding-msft edited

Deploying .net core application on live dedicated server

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-serverdotnet-csharp
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ShahzaibKhan-7927
Tag "office-deployment" focuses on general issues about planning, deployment, and compatibility of Office desktop products, as your issue is out of the scope of this tag, I will remove it. Thanks for your understanding.

0 Votes 0 ·

1 Answer

cooldadtx avatar image
0 Votes"
cooldadtx answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.