Iis – Should .NET MVC 3 actions trigger w3wp.exe to generate Process Monitor “PATH NOT FOUND” and “NAME NOT FOUND” errors

asp.net-mvciisiis-7.5

I asked this on Stack Overflow, but it was suggested that I also ask it here, since it could be related to IIS:

If I create an out-of-the-box ASP.NET MVC 3 Web Application (non-empty, Razor, no unit tests) and deploy it to an IIS 7.5 site (.NET 4, Integrated Pipeline), every controller action I trigger causes a ton of "name not found" and "path not found" errors in procmon.

The w3wp.exe process is trying to visit file system locations that the MVC Routing engine should pick up and handle. This is a small portion of the procmon log after clicking the "LogOn" link one time only:

Process Monitor Output

Is this expected behavior? It doesn't feel right to me.

I came across this because my server CPU utilization was pegged at 100%. One of my calls was happening frequently enough (causing the "path not found" error) that it was eating up CPU. As soon as I created a file system folder at the path it was trying to access, the CPU utilization dropped to 0% (~85 concurrent users on the site in both cases).

Best Answer

That is normal.

Each view file (.cshtml is a Razor view using C#) can be in a number of well known locations (this allows multiple view engines in a project and shared code). The first time a controller needs a view it has to be found.

Repeated requests for the same view should not cause further searches, but the ASP.NET MVC runtime will detect updates: check the file's (including project assemblies) don't have dates in the future or something triggering AppDomain restarts.