开发者

asp.net mvc 2 web application inside a Web site?

开发者 https://www.devze.com 2023-01-02 20:11 出处:网络
I have a Asp.Net Web Site deployed as a WebSite inside IIS 7.5. http://localhost/WebSite Then I have a second Asp.Net MVC 2 web application which is deployed as Sub Application inside the above We

I have a Asp.Net Web Site deployed as a WebSite inside IIS 7.5.

http://localhost/WebSite

Then I have a second Asp.Net MVC 2 web application which is deployed as Sub Application inside the above WebSite. So the mvc aplication should work on the following U开发者_如何学Gorl.

http://localhost/WebSite/MvcApp/

The web site works fine but when I browse the mvc Url http://localhost/WebSite/MvcApp/

It gives following error.

HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.

UPDATE: I have got this working. The issue was that I was missing the Web.Config inside the Views folder in the Asp.Net MVC 2 application.


You might need to create a virtual directory for the ASP.NET MVC application which will be associated to its dedicated application pool.


I know I had the same problem some time ago. In my case the two applications ran a siblings, not one inside the other. The problem was the web.config in the root directory (above the two sites) conflicting with the the web.config in the seperate sites. I solved it by just deleting the root web.config (since I have nothing running in the root.

So my advice (I know it's definately not a solution) is to check for conflicts in your web.configs.


Is you Asp.Net MVC site running ASP.NET 4.0? If so, make sure the app pool for that MVC site is setup asp ASP.NET 4.0 and not ASP.NET 2.0.


From within IIS Manager, you can right click any folder in the tree to be converted to an application. Have you tried it?


It sounds to me like the mvc routing module is not executing on your requests. You might want to check to make sure that not only is the web.config in your base web application not loading a module to supersede the routing handler, but that the web.config for your mvc application is handling routing properly. Take a look at this article for a rundown of the dependencies for routing and how it is configured internally within iis.

0

精彩评论

暂无评论...
验证码 换一张
取 消