In the near future, you need to publish the WEBAPI to IIS under the. NET Core framework for work reasons. Have suffered some devastation, hereby write down for later use.
First, there are 2 services in the work. One is IDENTITYSERVER4 service, responsible for the token of the distribution, one is our business webapi.
When the customer needs to call our Webapi, first go to Identityserver4 to apply for a token. Then use this token to visit our WEBAPI.
Authorized Server Identityserver4, is open source. can be obtained directly on Git. is developed based on the. NET Core. I'm using the. NET Core 1.0.
Here's how it's deployed. It is recommended to use the documentation provided by Microsoft. Document Address
Https://docs.microsoft.com/en-us/aspnet/core/publishing/iis
There are frequently asked questions common errors and workaround troubleshooting the document.
Because the server is server2012, the IIS version used is 8.5. Support itself supports. NET 4.5
1. Install IIS webserver
2 Installing the. NET core Windows Server hosting bundle
Note After the installation is complete, reboot the server, or perform net stop was/y followed by net start w3svc from command prompt to pick up a Chang E to the system PATH
Otherwise, it will be reported
502.3 Bad Gateway-there is a connection error while trying to route the request
Although it is mentioned in the troubleshooting in the document, it does not solve the problem according to that. It still has to be restarted. or that order.
3 Installing the. NET Core runtime library, the. NET Core SDK that I installed
Run dotnet in CMD to verify that the installation is correct.
4 the package released in VS, Put into IIS, very ordinary Web site publishing.
But in the application pool, the. NET Framework chooses to have no managed code.
The second WEBAPI publication is the same as the General MVC Web release.
5 If you report 500 internal errors or Webapi do not log correctly, view the configuration of the log and Iisuser permissions on the folder.
This is no different from other website releases.