razorgenerator

MVC RazorGenerator - “Type (…) already defines a member called 'Execute' with the same parameter types”

点点圈 提交于 2019-12-11 11:49:01
问题 I've been working on a big MVC Application and now i need to improve application's startup performance (which is bad +1min for the first load). I installed RazorGenerator nugget and the extension too, but when i compile a lot of errors appear. May this be caused by not specifying the Generator Type? Because i didn't find their documentation very helpful about this. Or maybe because i added the following directive to one of my views ( _EditHelperPage.cshtml ) because it was rendering as

Visual Studio cannot find custom tool RazorGenerator

二次信任 提交于 2019-12-09 07:23:14
问题 I've installed the NuGet package for RazorGenerator.mvc and then run the shell command Enable-RazorGenerator and get the following message: Exception calling "RunCustomTool" with "0" argument(s): "The custom tool 'RazorGenerator' failed. The method or operation is not implemented."At \packages\RazorGenerator.Mvc.1.3.2.0\tools\RazorGenerator.psm1:77 char:40+ $_.Object.RunCustomTool <<<< () + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId :

Override view in ASP.NET MVC site not working

江枫思渺然 提交于 2019-12-07 12:59:55
问题 I have a separate project in my solution that contains some Controllers and compiled views. I use those controllers for base classes to other controllers in my MVC application and the views are compiled using RazorGenerator. Lets say B is Base Controller with non abstract action method SomeAction that returns View("_MyView"). _MyView.cshtml is compiled using RazorGenerator. Lets say controller A inherits B but doesn't override SomeAction . I've tried to make another view "~/Views/A/_MyView

Override view in ASP.NET MVC site not working

↘锁芯ラ 提交于 2019-12-05 20:10:28
I have a separate project in my solution that contains some Controllers and compiled views. I use those controllers for base classes to other controllers in my MVC application and the views are compiled using RazorGenerator. Lets say B is Base Controller with non abstract action method SomeAction that returns View("_MyView"). _MyView.cshtml is compiled using RazorGenerator. Lets say controller A inherits B but doesn't override SomeAction . I've tried to make another view "~/Views/A/_MyView.cshtml" to override the default one, but it doesn't work. My question is how can I accomplish this?

Razor Generator: how to use view compiled in a library as the partial view for master defined in main mvc project

倖福魔咒の 提交于 2019-12-03 12:12:22
We have an ASP.NET MVC 4 application with around 3000 views in it. We've decided to split this set of views into separated DLLs and compile it with RazorGenerator. We keep only main _Layout.cshtml and related files in the main MVC project. We cannot load partial views from DLL together with master view in main MVC project. Detailed description is below. What is already done: The views compile successfully into DLLs (I've confirmed that they are in the binary) The PrecompiledMvcEngine object is created and registered for each DLL containing views using the code below in Application_Start in

RazorGenerator can't see custom cshtml helper

你说的曾经没有我的故事 提交于 2019-12-03 10:19:46
I'm having a problem with RazorGenerator: it can't compile views that uses my custom helper: App_Code/ViewHelper.cshtml @helper test(System.Web.Mvc.HtmlHelper html) { <h4>Test</h4> } Views/Test.cshtml (...) @ViewHelper.test(this.Html) (...) When I try to compile my project I get this error for Test.cshtml: The name 'ViewHelpers' does not exist in the current context I tried adding various namespaces to my Views/web.config file: <system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"

Visual Studio cannot find custom tool RazorGenerator

主宰稳场 提交于 2019-12-03 09:19:04
I've installed the NuGet package for RazorGenerator.mvc and then run the shell command Enable-RazorGenerator and get the following message: Exception calling "RunCustomTool" with "0" argument(s): "The custom tool 'RazorGenerator' failed. The method or operation is not implemented."At \packages\RazorGenerator.Mvc.1.3.2.0\tools\RazorGenerator.psm1:77 char:40+ $_.Object.RunCustomTool <<<< () + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : ComMethodTargetInvocation I also tried right-clicking and selecting "Run Custom Tool" and it provides a dialog

External razor views can't see external models

有些话、适合烂在心里 提交于 2019-12-02 19:37:42
问题 I have a problem with external razor views. In my project I have main mvc web assembly and dynamically loaded external class library assemblies(from DB) with their own Controllers, Views and Models. These assemblies are not directly referenced and loaded at runtime. I was able to make the whole system work by creating a custom controller factory for Controllers, a custom virtual path provider for Views. The views are embedded resources in my external assemblies. The problem I have is when I

External razor views can't see external models

蓝咒 提交于 2019-12-02 12:10:25
I have a problem with external razor views. In my project I have main mvc web assembly and dynamically loaded external class library assemblies(from DB) with their own Controllers, Views and Models. These assemblies are not directly referenced and loaded at runtime. I was able to make the whole system work by creating a custom controller factory for Controllers, a custom virtual path provider for Views. The views are embedded resources in my external assemblies. The problem I have is when I create a strongly-typed external View with a model class from an external assembly the view cannot be

Is it possible to save an MVC Razor view into an actual html file

六眼飞鱼酱① 提交于 2019-11-30 13:09:05
We are building an MVC app that creates physical HTML pages. The app currently creates the pages dynamically using the normal MVC/Razor approach. Rather than re-creating the output programatically to a file, is there anyway to grab the result built by razor and save it to a file? Thanks so much! you can render the view to string, then save the string in a file ... public string RenderViewToString(string viewName, object model) { ViewData.Model = model; using (var sw = new StringWriter()) { var viewResult = ViewEngines.Engines.FindPartialView(ControllerContext, viewName); var viewContext = new