Areas over multiple projects - Views not found in child projects

给你一囗甜甜゛ 提交于 2019-12-01 21:09:50

I put "multi project areas" in Google and came accross this post: http://forums.asp.net/p/1494640/3540105.aspx. Note specifically Phil Haack's response.

It appears that defining your views in the parent project is "functioning as designed" because of this entry in the MSDN post: 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.

The "problem" with the post is that it was defined for the beta where this build step was easily accessable. RC+ you have to point to the Futures assembly and assign the build step slightly differently if this is the path you choose.

If you don't like the direction this pushes you, the portable areas portion of MvcContrib Phil mentions is about as good as you're gonna get to an alternative.

I went through the same pain as you. This is what I did.

  1. Made sure I was running MVC 2 RC (uninstall beta 2, install the RC).
  2. Recreated the project from scratch.
  3. No need to edit the csproj files, no need to create a routes.cs, and no need to edit global.ascx.cs, just right click the main project to get the context menu. From the Add menu item you can create a new area.
  4. The views have to be in the main project or you can use the information in this post http://forums.asp.net/p/1494640/3540105.aspx, which I plan on doing so the views are in each area.

It doesn't support the Multi-Project areas, but for now that's ok with me. The link above does point you in the direction for multi-project areas.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!