简体   繁体   中英

How to deploy an ASP.NET Core 6 application with Angular 12 on IIS

I used the publish feature of Visual Studio to publish my project in a folder. After that I added a Website to IIS on my web server and bound it to the folder where I put all the generated files.

The publish folder looks like this:

发布文件夹

The IIS structure looks like this:

IIS

When I start the website, it just loads and loads without achieving any result.

As Lex said, you should check the browser's develop tool to see what the server replied.

And also I suggest you could try to open the browser to type in the https://youriissitedomain:port/api/controllername to call your web api to see what server has returned to make sure your asp.net core server-side has works or not.

If it doesn't work, I suggest you could firstly check you have install the right .net core runtime for your server from this article .

Then I suggest you could make sure your IIS web site's application pool has the right permission to access the folder. For more details about how to check,you could refer to this answer .

you could follow the below steps to deploy the angular asp.net core app to the iis:

  1. Download and Install asp.net core 6 runtimes and hosting bundles

https://dotnet.microsoft.com/en-us/download/dotnet/6.0

在此处输入图像描述

  1. Open the project in a visual studio.

  2. Right-click on the project and choose publish:

在此处输入图像描述

  1. In target select folder option:

在此处输入图像描述

  1. Set the folder path where you want to publish the site.-> click Finish

  2. Now open iis click on the server name and select add website

  3. While adding a website give any name, select your publish folder and set the port number -> click ok

在此处输入图像描述

  1. To browse the site select site name and click browse from the action pane.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM