Skip to content

Commit

Permalink
修复因为带上特性导致分部类型构建失败
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Oct 21, 2023
1 parent cd16583 commit ae3e34e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ namespace {@namespace}
{{");
}

var generatedCodeAttributeSource = AssemblyInfo.GeneratedCodeAttribute;
// 不要带上 System.CodeDom.Compiler.GeneratedCodeAttribute 特性,因为一个类型如果是分部类型,可能有多个逻辑都在生成在不同的文件,如果这些文件同时都加上 GeneratedCodeAttribute 特性,将会导致 error CS0579: “global::System.CodeDom.Compiler.GeneratedCode”特性重复
//var generatedCodeAttributeSource = AssemblyInfo.GeneratedCodeAttribute;

// Add the core implementation for the derived context class.
string partialContextImplementation = $@"
{generatedCodeAttributeSource}
{declarationList[0]}
{{
{IndentSource(memberCode, Math.Max(1, declarationCount - 1))}
Expand Down

0 comments on commit ae3e34e

Please sign in to comment.