C# C“T4模板”;“错误”;转型期

C# C“T4模板”;“错误”;转型期,c#,t4,C#,T4,我有一个C#项目,其中有8个T4模板,可以根据我的DBML自动转换我的模型/服务/回购等 在实际编译项目时,一切都转换得很好,没有收到任何错误,但是在实际运行transformall Templates命令时,我确实收到了以下消息。即使它看起来并没有影响任何事情,我只是想弄清这个错误的根源。有什么想法吗 Error 44 Running transformation: System.IndexOutOfRangeException: Index was outside the bounds

我有一个C#项目,其中有8个T4模板,可以根据我的DBML自动转换我的模型/服务/回购等

在实际编译项目时,一切都转换得很好,没有收到任何错误,但是在实际运行
transformall Templates
命令时,我确实收到了以下消息。即使它看起来并没有影响任何事情,我只是想弄清这个错误的根源。有什么想法吗

Error   44  Running transformation: System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.VisualStudio.TextTemplatingA0408758CBA091AEC8619A75CCA2AD32.GeneratedTextTransformation.TransformText() at Microsoft.VisualStudio.TextTemplating.TransformationRunner.RunTransformation(TemplateProcessingSession session, String source, ITextTemplatingEngineHost host, String& result)      1   1   


解决方案中是否存在T4文件或任何本地实际上不存在的项目?也许它不在下载的源代码中。这可能会在解决方案资源管理器中显示为黄色感叹号,而不是错误


另外,您没有提到是否手动运行每个模板,以确保它们都正常运行。

双击它时,它会移动到任何地方吗?Bobson-不,它只是放在那里。这是一张错误的图片。奇怪。如果您使用的是Visual Studio 2012,请尝试使用该模板。如果你是在2010年,试试吧。警告:我从来没有让T4去工作过。