EF 4 自跟踪实体生成器错误模板不包含 NeedsHandleCascadeDeleteMethod 的防御
当尝试使用 Visual Studio 2010 生成自跟踪实体时,出现以下错误:
编译转换:
“Microsoft.VisualStudio.TextTemplateFD3088D2F02A7E80E5DF5FEC4C1DAB39.GenerateTextTransformation.MetadataTools” 不包含以下定义 'NeedsHandleCascadeDeleteMethod' 和 没有扩展方法 '需要HandleCascadeDelete方法' 接受类型的第一个参数 'Microsoft.VisualStudio.TextTemplateFD3088D2F02A7E80E5DF5FEC4C1DAB39.GenerateTextTransformation.MetadataTools' 可以找到(您是否缺少 using 指令或程序集 参考?)
我在其他项目上使用过自我跟踪实体功能,以前没有遇到过这个问题。我唯一能想到的就是我已经将SP1应用到了Visual Studio中。我需要安装更新的模板还是应该卸载 SP1?
谢谢!
When trying to generate self-tracking entities using Visual Studio 2010 I am getting the following error:
Compiling transformation:
'Microsoft.VisualStudio.TextTemplatingFD3088D2F02A7E80E5DF5FEC4C1DAB39.GeneratedTextTransformation.MetadataTools'
does not contain a definition for
'NeedsHandleCascadeDeleteMethod' and
no extension method
'NeedsHandleCascadeDeleteMethod'
accepting a first argument of type
'Microsoft.VisualStudio.TextTemplatingFD3088D2F02A7E80E5DF5FEC4C1DAB39.GeneratedTextTransformation.MetadataTools'
could be found (are you missing a
using directive or an assembly
reference?)
I have used the self-tracking entities feature on other projects and have not had this problem before. The only thing I can think of is that I have applied SP1 to Visual Studio. Is there an updated template I need to install or should I just uninstall SP1?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在升级到 VS 2010 SP1 之前安装了 STE 模板很长时间,但没有遇到此问题。
检查
EF.Utility.CS.ttinclude
中NeedsHandleCascadeDeleteMethod
的定义。您将在C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes
中找到此文件(如果您使用默认安装路径) VS)。该方法的定义应如下所示:同时检查项目中使用的 STE 模板(实体部分,而不是上下文部分)。它应该仅通过调用以下方法使用该方法一次:
如果您看到其他任何内容,则您的模板可能以某种方式损坏或您修改了它。尝试再次安装。
I installed STE template long time before I upgraded to VS 2010 SP1 and I don't have this issue.
Check the definition of
NeedsHandleCascadeDeleteMethod
inEF.Utility.CS.ttinclude
. You will find this file inC:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Entity Framework Tools\Templates\Includes
(if you used default installation path for VS). The method should be defined like:Also check your STE template used in the project (the part for entities, not the part for context). It should use the method only once by calling:
If you see anything else your template is probably somehow corrupted or you modified it. Try to install it again.