View not found exception when running ASP.NET MVC site from network share

I am getting a View not found exception when an ASP.NET MVC site is configured with a home directory pointing to a network share in IIS.

The weird thing is that this error appears intermittently, sometimes the view loads fine and others the same view doesn't work.

I've tested this on IIS 6 and 7, both have the same problem.

I also have other ASP.NET WebForms sites on the same web server configured in the same way (files from a network share) and they have no problem, which makes me believe it is a bug in the MVC framework. in particular in the view mode.

Has anyone else experienced something similar and / or knew a solution?

Thank you, Raphael.

+2


source to share


1 answer


The connection to shared drives is not persistent, which means that the connections are "refreshed" in some sense upon access. Since web forms collect the entire site at runtime, the pages are accessed once during the compilation process (in a precompiled application, you even need aspx pages).

However, in MVC, only the code in the controllers is compiled, leaving on-demand accesses at runtime. If the view is not immediately available, the MVC engine will throw an exception.



So, if you hit the MVC application, then the first time it will throw an error stating that it cannot find this view, but after subsequent requests immediately after it finds the view without issue. Until the connection state of the shared folder is closed when you get the error again.

0


source







All Articles