-
Notifications
You must be signed in to change notification settings - Fork 355
Description
Setup
ASP.NET WebForms - .aspx,.asmx, *.ashx + WebAPI2 with attribute routing application. 32-bit enabled.
Scenario
- Recycle the app pool. Optional. Only necessary if needed to make IIS release files.
- Delete
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\<appname>folder.
Observed
WebAPI2 routes begin throwing 404 errors, WebForms routes work fine.
Detailed Error Information:
| Module | IIS Web Core |
|---|---|
| Notification | MapRequestHandler |
| Handler | StaticFile |
| Error Code | 0x80070002 |
| Requested URL | https://<redacted> |
|---|---|
| Physical Path | C:\<redacted> |
| Logon Method | Anonymous |
| Logon User | Anonymous |
At this point if the app pool is recycled, WebAPI2 starts working again
Expected
WebAPI2 routes should work.
It should not be necessary to recycle the app pool after the temp asp files folder is re-created.
Notes
Upon first request (regardless whether to WebForms or WebAPI2), the temp folder is re-created (as it should). Application tracing confirms that the OWIN Startup class is loaded and Configure (which calls MapHttpAttributeRoutes while wiring up the Web API) is called.
IIS preload settings does not seem to matter.
Recycling the app pool before the temp folder is created does not fix the issue.