Reputation: 4202
I would like to centralize partial views and controls for our corporate apps, but when I try and reference a partial view hosted in a different virtual directory (iis6), it throws the error:
"The virtual path '/CommonWeb/views/_Grid.cshtml' maps to another application, which is not allowed."
Is there some way to allow this functionality easily?
Upvotes: 2
Views: 425
Reputation: 10601
Take a look at the RazorGenerator project, which allows you to compile your views into a library, which you could then reference from multiple MVC projects.
Upvotes: 3
Reputation: 3932
normally for anything that would be central the easiest method would be to create nuget packages for your code, you can then upgrade your systems nuget package as and when you make changes to your main trunk / re-usable features, this way you dont have to worry about cross domain request etc or having to build some kind of API.
http://docs.nuget.org/ is the documentation
and a self updating website with nuget\
http://haacked.com/archive/2011/01/15/building-a-self-updating-site-using-nuget.aspx
may note be the best, but it does create the ideal situation of code once and use everywhere
Upvotes: -1