1、环境安装
2、部署iis
和原来的net部署一样,唯一区别是将托管模式修改为无托管
另外可配置web.config,方便输出站点日志
<?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\API.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" /> </system.webServer> </location> </configuration>
扩展:
.netcore的托管模式主要分2种:进程内托管和进程外托管
在 IIS 工作进程 (w3wp.exe) 内托管 ASP.NET Core 应用,称为进程内托管模型。
将 Web 请求转发到运行 Kestrel 服务器的后端 ASP.NET Core 应用,称为进程外托管模型。
通过修改项目文件配置如下,修改为进程内托管,默认没有或者设置为OutOfProcess为进程外托管模式