<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\xxx.exe"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess" />
</system.webServer>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\xxx.exe"
stdoutLogEnabled="true"
stdoutLogFile=".\logs\stdout"
hostingModel="outofprocess" />
</system.webServer>
</configuration>
inprocess vs outofprocess 两种模式对比
| | inprocess | outofprocess |
| 运行方式 |
应用跑在 IIS 工作进程内(w3wp.exe) |
应用跑在独立进程里(你自己的 exe) |
| 性能 |
更快,少一层转发 |
稍慢,多一层代理 |
| 权限 |
继承 IIS 应用池权限 |
相对独立 |
| 稳定性 |
崩了会影响 IIS |
崩了不影响 IIS 本身 |
| 相当于 |
ASP.NET 经典模式 |
反向代理模式 |