我使用外部工具生成了一些C#代码。每个生成的类都有一个属性GeneratedCodeAttribute。为什么我的生成器要创建此属性? 最佳答案 设置此属性是因为此代码是由工具生成的,而不是由人生成的:)您可能会问它有什么用?MSDN告诉我们:TheGeneratedCodeAttributeclasscanbeusedbycodeanalysistoolstoidentifycomputer-generatedcode,andtoprovideananalysisbasedonthetoolandtheversionoftheto