Running an MVC application as a subtask?

I am trying to create an MVC application as a sub-application for my standard Asp.Net web application. Both of these projects are in the same solution. While the parent application is working fine, I am having problems with the work of the subquery. After massaging some of my two web.configs, I was able to get Asp.Net runtime to accept the configurations, but I could not find any of the pages / controllers in the MVC application, including the root of the -application subdirectory (" http: // RootSite / SubApplicationName / "). I keep getting 404.

In fact, I get an answer when I go to the URL " http: // RootSite / SubApplicationName / Home / Index / ". It redirects me to index.aspx in this folder and throws this error:

Unable to find the index view or its master. The following locations were searched:
    ~ / View / Home / Index.aspx
    ~ / Views / Home / Index.ascx
    ~ / Views / Shared / Index.aspx
    ~ / Views / Shared / Index.ascx

The sub-application in IIS (7) is configured quite straightforwardly: it runs in the same application pool as the parent application that runs Asp.Net 2.0 in integration mode.

My suspicion is that I have something in the web.configs file that discards it. Are there any things regarding, say, HTTPModules or URL authorization modules, etc. that I must confirm do not interfere with MVC?

Also, should the global.asax.cs file use a different default route? By default, the url parameter is passed to route.MapRoute:

"{controller}/{action}/{id}"

Should it be preceded by the name of the sub-application, for example?

"SubApplicationName/{controller}/{action}/{id}"

I tried to change something like that, but it doesn’t fix it.

Any ideas are greatly appreciated. In addition, general information on setting up an MVC web application as a sub-application will be excellent.

Thanks.

+5
source share
3 answers

- , , dll. , -, , .

, , VirtualPath, , . , , :

http://www.wynia.org/wordpress/2008/12/05/aspnet-mvc-plugins/

, ;)

+1

, Views. , 30 , . IDE - (.. , , , , - " " ).

0

The routine is not suitable for the MVC web application directly. you need to write a lot of hacked code in global.asax. Use a subdomain, not a sub-application.

0
source

All Articles