mMy task is to create an action allows to get a downloadable copy of another asp.net MVC site output (let's think of it as a template and the result should be zipped collection of pages). The template site is located somewhere on the disk, but not inside the renderer site. I.e. I want to load a view of another site and dynamically build it's output in current context. I've solved a problem of locating a view by creation of custom VirtualPathProvider / VirtualFile and eventually the path is resolved correctly. However, I have a compilation error in the code:
var engine = new EmbeddedViewEngine("My Custom Project", "Custom Site");
// Here goes the error.
ViewEngineResult viewResult = engine.FindView(this.ControllerContext, "Index", "", false);
Result:
c:\Users\me\AppData\Local\Temp\Temporary ASP.NET Files\root\28ca69a5\2e195676\App_Web_index.cshtml.fb05bd29.4rma-j2y.0.cs(40)
: error CS0103:
The name 'ViewBag' does not exist in the current context
Any ideas?