0

I'm trying to use MEF + MVC3.

I have 2 projects. One where I should "dynamically" render the other modules and I call it Shell. The second project is where I have a certain module, that I want to load inside Shell.

I was able to dynamically instantiate one controller from the module, using MEF, but everytime it redirects to the View it fails to find it.

Do I have to "copy+paste" the Views from all my modules/plugins to my Shell? Or there is any other solution?

  • I get "The view 'Index' or its master was not found or no view engine supports the searched locations". This happens because I don't have any View inside my project Shell – Francisco Correia May 07 '12 at 13:14

2 Answers2

0

You need to copy the .cshtml (or .aspx) view files to the actual application directory.

Views are not compiled into projects; instead, they are read from the web application directory at runtime.

If you want to, you can make your own VirtualPathProvider that reads views from something else.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

If you are using .aspx files then you need to make them an embedded view.

gblock
  • 790
  • 4
  • 11
  • 25