views:

15

answers:

2

Hey everyone,

I've been reorganising our views at work and moving them around to more appropriate locations.

Because we're currently organising many of our views into their own folders within the Views folder, we're having to reference our views using the full path in RenderView.

Is there a way that I can get Visual Studio to throw a build error if the location of the ascx file that the RenderPartial method points to doesn't exist?

There is an error shown at run time however I'd like it to be part of the build process.

Thanks for any advice

A: 

View locations are resolved only at runtime so I really don't see how this could be done, unless you write some custom step in MSBuild that will analyze the source code and check the existence of corresponding view files but this will be a challenging task.

Darin Dimitrov
A: 

MvcBuildViews might help with this:

http://stackoverflow.com/questions/383192/compile-views-in-asp-net-mvc

big dave