Skip to content

BUG: WebAPI2 requires app pool recycle after the very first request  #245

@Peperud

Description

@Peperud

Setup

ASP.NET WebForms - .aspx,.asmx, *.ashx + WebAPI2 with attribute routing application. 32-bit enabled.

Scenario

  1. Recycle the app pool. Optional. Only necessary if needed to make IIS release files.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions