MVC RazorGenerator - "类型(......)已经定义了一个名为具有相同的参数类型和QUOT“执行”成员; [英] MVC RazorGenerator - "Type (...) already defines a member called 'Execute' with the same parameter types"

查看:428
本文介绍了MVC RazorGenerator - "类型(......)已经定义了一个名为具有相同的参数类型和QUOT“执行”成员;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作在大的MVC应用程序,现在我需要提高应用程序的启动性能(这是第一个载荷差+ 1分钟)。

我安装RazorGenerator金块和延长了,但是当我编译了很多错误的出现。

VS错误

这可以通过不指定的发电机类型引起的?
因为我没有找到自己的文档,这个非常有帮助的。

或者,也许是因为我加入了以下指令来我的观点一( _EditHelperPage.cshtml ),因为它是为渲染 HelperPage 而不是 WebViewPage

  @ *发电机:MvcView * @

在我删除此行并将其添加到 razorgenerator.directives ,它引发了我另一个错误:

助手页面错误

修改

如果我搜索类/构造具有相同的名称,它找到 / OBJ / codeGEN /(...)

解决方案

我发现这个问题。

在我安装了VS扩展RazorGenerator(不是金块!),我安装RazorGenerator.MsBuild这不一样的扩展,但是,建造的时间(right?)。

但为什么会发生?
我认为延长建立的MSBuild之前的观点,但他们在做相同的,因此创建复制的.cs 文件

我只是unistalled .MsBuild 包,瞧,它的工作原理。

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 HelperPage instead of WebViewPage:

@* Generator: MvcView *@

After i remove this line and adding it to razorgenerator.directives, it throws me another error:

Edit

And if i search for a class/constructor with the same name, it find results in /obj/CodeGen/(...)

解决方案

I found the problem.

Before i installed the VS Extension RazorGenerator (not the nugget!), i installed RazorGenerator.MsBuild which does the same as the extension but on build time (right?).

But why was it happening? I think that the extension builds views before MsBuild, however they were doing the same and therefore creating duplicated .cs files

I just unistalled .MsBuild package and voilá, it works.

这篇关于MVC RazorGenerator - "类型(......)已经定义了一个名为具有相同的参数类型和QUOT“执行”成员;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆