3

Has anyone been able to create an Asp.Net Mvc plug-in implementation using MEF (or some other IoC tools) that does NOT require the Razor views to be compiled into dll's? Ideally, I'd like to be able to deploy Razor view changes by simply dropping new files in a folder rather than having to recompile and drop new dll's. Any ideas?

1

1 Answer 1

1

By default views are not compiled so you should be able to do this without any extra work.

Sign up to request clarification or add additional context in comments.

7 Comments

Has this been proven in practice? I keep running into the following error message: "The view at '~/Plugins/Views/Index.cshtml' must derive from WebViewPage, or WebViewPage<TModel>"
This definitely works when using the VS dev server, I'm not able to test with IIS proper at the moment though. The error you mentioned sounds like there is a web.config file missing in your /Views/ folder.
I added a web.config which is a direct copy of another web.config from another views folder and it still throws the error. I'm really curious how the view could be picked up by the view engine with no problems but the view isn't seen as a legitimate Razor view. Is there more to a Razor view than just the *.cshtml extension?
I've just tested this on full IIS with a default MVC3 project and it works fine. To be honest I'm not sure why you're getting that error. From what I understand a razor view is the .cshtml file, the correct mvc folder structure and a web.config with the appropriate settings for base type, namespaces, config section etc.
Adam, is your plugins folder in a specific location? How does your action method in your controller look?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.