views:

116

answers:

2

Was just wondering if this was normal behavior as I'm fairly new to ASP.NET MVC. When I monitor the site usage via procmon I see the following:

7:19:17.0053886 PM w3wp.exe 3992 QueryOpen C:\www\inetpub\ControllerName.mvc\ActionName PATH NOT FOUND

(This site is setup to run on IIS6/MVC2 - the reason for the .mvc extention)

This is happening when the ControllName.mvc\ActionName URL is hit.

+2  A: 

the .mvc extension is mapped to the ASP.NET runtime which processes the request using ASP.NET MVC engine. It does the following:

  1. Starts the routing engine.
  2. The "router" looks if the file in the request exists on the file system. If yes, it returns it to IIS which will render the static file.
  3. If it does not exist, the ASP.NET routing executes appropriate actions.

So your log is the result of step 2 here. It is normally should not be performed.

I know one reason why it runs though: you have RouteExistingFiles set to true. You need to check it to be set to false (which is the default).


One more observation is that w2wp looks for file in the root of inetpub, which means the application is located in the Root of the web site and not in the Virtual Directory. If it is not true, then you should check the location of the application on disk and structure of the web site. Maybe there is just some collision.

Dmytrii Nagirniak
That's helpful in understanding the flow or routing in asp.net MVC. I've set the value to false in the global.asax.cs file and procmon shows it still looking for file paths.
dbr
That's interesting. I've updated the answer to give you another clue. But can you confirm the exact log entry, application location on the disk and if the application is running in the root of Web Site?
Dmytrii Nagirniak
I don't see any problem. Like you said Dmitriy, in step 2 the routing engine looks if the file exists thus creating a QueryOpen event. How would it otherwise check if a file exists without looking for it?
ZippyV
@ZippyV, the problem is that it should NOT look up the file when `RouteExistingFiles=false` (which is by default).
Dmytrii Nagirniak
A: 

Have you unticked the "Verify that file exists" box in IIS?

It's in the properties of the Website -> Home Directory -> Configuration -> Wildcard Application maps -> your existing aspnet map

Unfortunately, the screenshot on the Microsoft page has the box ticked while the text says "Uncheck the checkbox labeled Verify that file exists"

Michael Stum
It is unchecked for the .mvc handler. I'm not using the wild card mapping.
dbr
Just a note, if the box would be ticked, then it would be IIS process not w3wp.
Dmytrii Nagirniak