Areas over multiple projects - Views not found in child projects

I follow this guide from MSDN on "Creating an ASP.NET MVC Application Using Multiple Projects" . Since ASP.NET MVC 2.0 is just a preview, it can be assumed that there are some errors.

My problem is that it just doesn't work! At least not as suggested. After setting everything up and pressing F5, you might think that this will work, neatly! BEEEP. Wrong.

He does not find the "View" in a child project! Because in my case, he is trying to perform a search inside ~/Views, which, of course, is in the parent!

When debugging, I see that it starts the controller inside my child project, but when used return View();in this action, it looks at the parent view folders.

I ask, error or function?

I tried it both in Vs2009, Vs2010, and in Framework 3.5 and 4.0.

+3
source share
2 answers

I posted the “multi-project areas” on Google and got to this post: http://forums.asp.net/p/1494640/3540105.aspx . Pay attention to Phil Haack's answer.

It looks like the definition of your views in the parent project “works as designed” due to this entry in the MSDN message: Now that all the code is in place, the final step is to customize the build process for each area project. This customization causes some child-area files, such as the views, to be copied to the main project before the application is built.

"" , -, . RC + Futures , .

, , MvcContrib Phil , .

+4

, . , .

, . .

0

Source: https://habr.com/ru/post/1724598/


All Articles