By this link, you can read about ASP.NET Core Module
To configure an app for in-process hosting, add the property to the app's project file with a value of InProcess (out-of-process hosting is set with OutOfProcess)
I've read several times but I don't understand what it's mean?
When I must use OutOfProcess and when InProcess?
Pros and cons these models?
What to rely on when making a decision?
Is referring to how IIS is hosting your app (web.config).
InProcess : IIS host the app (w3wp.exe or iisexpress.exe)
OutOfProcess: Kestrel host the app, IIS is a proxy to kestrel.
More details on how to configure and what to keep in mind for each one when using.
'InProcess' has significant better performance according to Microsoft.
To configure InProcess add web config with:
<?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="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess">
<environmentVariables />
</aspNetCore>
</system.webServer>
</location>
</configuration>
For OutOfProcess:
<?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="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="OutOfProcess">
<environmentVariables />
</aspNetCore>
</system.webServer>
</location>
</configuration>
when you will generate the build in my-api folder or plain publish to your server with:
dotnet publish -o my-api -c release
will take care if your %LAUNCHER_PATH% and %LAUNCHER_ARGS%.
What you are referring in initial question possibly is about .csproj config that dictate how app runs locally, default is OutOfProcess
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With