Skip to content

Commit b4f33ef

Browse files
author
rhamlett_microsoft
committed
Added web,config to ensure the app runs in process
for Crash Monitoring to trigger and capture crash dumps in Azure.
1 parent 4996d85 commit b4f33ef

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/PerfProblemSimulator/PerfProblemSimulator.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
<PropertyGroup>
99
<!-- Enable unsafe code for AccessViolation crash simulation -->
1010
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
12+
<!--
13+
Use InProcess hosting for Azure App Service.
14+
This runs the app inside w3wp.exe (IIS worker process) instead of a separate dotnet.exe.
15+
Azure Crash Monitoring monitors w3wp.exe, so InProcess is required for crash dump collection.
16+
-->
17+
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
1118
</PropertyGroup>
1219

1320
<ItemGroup>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<location path="." inheritInChildApplications="false">
4+
<system.webServer>
5+
<!--
6+
Azure App Service Hosting Configuration
7+
8+
hostingModel="inprocess" - Run inside w3wp.exe (IIS worker process)
9+
This is REQUIRED for Azure Crash Monitoring to capture crash dumps.
10+
11+
When hosting model is "outofprocess", the app runs in a separate dotnet.exe process,
12+
and Azure Crash Monitoring (which monitors w3wp.exe) won't capture crashes.
13+
-->
14+
<handlers>
15+
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
16+
</handlers>
17+
<aspNetCore processPath="dotnet"
18+
arguments=".\PerfProblemSimulator.dll"
19+
stdoutLogEnabled="false"
20+
stdoutLogFile=".\logs\stdout"
21+
hostingModel="inprocess">
22+
<environmentVariables>
23+
<!-- Enable detailed errors for diagnostics -->
24+
<environmentVariable name="ASPNETCORE_DETAILEDERRORS" value="true" />
25+
</environmentVariables>
26+
</aspNetCore>
27+
</system.webServer>
28+
</location>
29+
</configuration>

0 commit comments

Comments
 (0)