Visual Studio代码分析生成的文件 [英] Visual studio code analysis for generated files
本文介绍了Visual Studio代码分析生成的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我为什么代码分析会显示生成的文件中的问题吗?我确实在此处检查选项:
http://msdn.microsoft。 com / en-us / library / dd742298.aspx
Can somebody tell me why code analysis shows issues from generated files? I do check option as here: http://msdn.microsoft.com/en-us/library/dd742298.aspx
我认为这与我在实体框架模型中使用TT tempate有关。
I think it has to do with the fact that I use TT tempate with my Entity framework models. But those files have tags on them..
推荐答案
您可以让TT模板将以下内容输出到标题中吗?
Can you have your TT templates output the following into the header?
//<autogenerated/>
或更具体地说,是文件中的某些项目:
Or to be more specific to certain items in file:
[GeneratedCode("MyTool", "1.0")]
public partial class GeneratedModel
{
...
这篇关于Visual Studio代码分析生成的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文