Basically you will need to extend MvcViewEngine, to tell MVC to look for your Views in the different from standatd pathes:
public class YourMegaViewEngine : WebFormViewEngine
{
public YourMegaViewEngine ()
{
ViewLocationFormats = new string[]
{
"~/Views/Administration/{1}/{0}.cshtml"
};
}
}
Uhmm.. I`ve been reading around and as far as I could understand, there are two options for me.
I can either do as you said, or I can got Razor Generator style (http://razorgenerator.codeplex.com/)
Since I was planning on creating "modules", they would be easier to install if they were a single file. So I`m leaning to go that way. Although i`m having trouble with the images and scripts. Can I compile them aswell as Resources and access them?
lucasphillip
Member
5 Points
11 Posts
MVC 4 - Have webapp saparated in many assemblies
Apr 09, 2012 10:02 PM|LINK
Hi there!
How can I create and use areas that are in different assemblies, like discribed here:
http://msdn.microsoft.com/en-us/library/ee307987.aspx
But that walkthrough does not work for a while now. And all articles I find on the web are as old as or even older then that one.
Can anyone help me out here? Is it still possible to set the MVC areas in different assembly? I could realy use some up to date help
Thanks
ignatandrei
All-Star
135110 Points
21675 Posts
Moderator
MVP
Re: MVC 4 - Have webapp saparated in many assemblies
Apr 10, 2012 04:11 AM|LINK
Please download http://pmkb.codeplex.com/ . It shows how to put views in a different project.( see plugin file)
I will write a tutorial ASAP.
lucasphillip
Member
5 Points
11 Posts
Re: MVC 4 - Have webapp saparated in many assemblies
Apr 10, 2012 05:27 PM|LINK
Not an easy thing to get someone elses code and understand it. Specially without comments.
I've been reading it and trying to understand what you did there. Would be great to have that tutorial though
Meanwhile, anyone else got a solution?
Thanks
Young Yang -...
All-Star
21343 Points
1818 Posts
Microsoft
Re: MVC 4 - Have webapp saparated in many assemblies
Apr 11, 2012 08:21 AM|LINK
Hi
Basically you will need to extend MvcViewEngine, to tell MVC to look for your Views in the different from standatd pathes:
public class YourMegaViewEngine : WebFormViewEngine { public YourMegaViewEngine () { ViewLocationFormats = new string[] { "~/Views/Administration/{1}/{0}.cshtml" }; } }You can look at this article: http://dotnetslackers.com/articles/aspnet/storing-asp-net-mvc-controllers-views-in-separate-assemblies.aspx
You can also check this thread: http://stackoverflow.com/questions/910089/how-to-separate-model-view-and-controller-in-an-asp-net-mvc-app-into-different
Hope this helpful
Regards
Young Yang
Feedback to us
Develop and promote your apps in Windows Store
lucasphillip
Member
5 Points
11 Posts
Re: MVC 4 - Have webapp saparated in many assemblies
Apr 11, 2012 02:35 PM|LINK
Uhmm.. I`ve been reading around and as far as I could understand, there are two options for me.
I can either do as you said, or I can got Razor Generator style (http://razorgenerator.codeplex.com/)
Since I was planning on creating "modules", they would be easier to install if they were a single file. So I`m leaning to go that way. Although i`m having trouble with the images and scripts. Can I compile them aswell as Resources and access them?