0

I have an ASP MVC application that I have deployed on a hosting service (discountasp.net) to an application folder that is a sub folder of the root application. ie:

-/[root]
-+/apps

both root and apps are setup as application folders in IIS.

When I hit the default page I get the error "The view '' or its master could not be found. The following locations were searched".

This application works when I deploy it on my test servers and I have verified that everything is correctly deployed, views are there, correct assemblies seem to be there. I believe that the MVC application is not using the correct application root and thus is unable to find the view pages.

I've read a number of related posts on this error, but none of the typical solutions are my problem: missing view files, missing master file. This works on a test machine that I have setup as closely to the hosting company as I can. Even when I have nested application folders.

Any thoughts on how to correct this?

MikeD
  • 923
  • 4
  • 12
  • 24
  • The App works if I deploy it to the root. It also works if it is deployed in apps with nothing deployed in root. As soon as I put anything as simple as a default.aspx file in root it stops working. – MikeD Nov 11 '09 at 23:41
  • Actually looks like when I drop the web.config into the root for the root application then it stops working. – MikeD Nov 12 '09 at 00:05

3 Answers3

1

Do you know which version of IIS is running?

Your best results will come with IIS 7 in Integrated Pipeline Mode.

You can run in 6, but you have to do some work to get it going.

Here are a couple of helpful links: ASP.NET MVC in a virtual directory

http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

Community
  • 1
  • 1
jeffa00
  • 677
  • 4
  • 10
1

So to close the loop on this. What the problem ended up being was the two separate web.config files where the root web.config was setting values that I was not removing in the sub application. I removed these and everything worked fine.

MikeD
  • 923
  • 4
  • 12
  • 24
0

Is "apps" part of the web folder hierarchy, or just a physical directory?

In case of the former: the view engine is going to check the /views folder for views, not /apps/views. You can modify (inherit and override) the default web form view engine and tell it where to find views, as indicated in this thread.

I think its funny how everyone keeps talking about how much more power MVC gives you over the request-response cycle, but I keep seeing these questions about very important parts of the process that are completely obscured and non-configurable. I'm not impressed with MVC.

Community
  • 1
  • 1
3Dave
  • 28,657
  • 18
  • 88
  • 151
  • apps is a physical directory that is setup as an application directory – MikeD Nov 11 '09 at 16:21
  • and ya, I'm just evaluating MVC with a simple little app, not sure if I buy in yet... – MikeD Nov 11 '09 at 16:23
  • What is not configurable here? You _can_ change view locations as you need, can't you? Notice that VirtualPathProvider is not MVC, it is ASP.NET option - that's MS decision to keep compatibility with old ASP.NET (that you seem to like). Also, I don't think it's THAT hard; this question seems to have an easier answer: http://stackoverflow.com/questions/236972/using-virtualpathprovider-to-load-aspnet-mvc-views-from-dlls – queen3 Nov 11 '09 at 18:33
  • 1
    What's not configurable? I shouldn't have to name my classes "HomeController", "FrakController", whatever, instead of whatever name makes sense in the context of my app. The routing mechanism should take a type reference not a string. I shouldn't have to create a new class to tell MVC where to find views; it should be in a config file. (Yes, I know I could do that myself, but that's more work to get around asinine assumptions in the framework). And, oh, yeah - not being able to put presentation-specific code in a view code-behind? WTF? So that the framework "enforces" the design pattern? Lame. – 3Dave Nov 11 '09 at 18:43