@@ -265,6 +265,7 @@ TypeDefinition AddClass(string name, TypeAttributes extraAttributes = 0)
265
265
} ;
266
266
loaderDispatcherDef . Methods . Add ( loaderDispatcherMethod ) ;
267
267
loaderDispatcherDef . Methods . Add ( loaderDispatcherMethodOld ) ;
268
+ typeSystem . AddCompilerGeneratedAttribute ( loaderDispatcherDef ) ;
268
269
269
270
270
271
var stringEquals = asm . MainModule . ImportReference ( asm . MainModule . TypeSystem . String . Resolve ( ) . Methods . First (
@@ -371,7 +372,7 @@ bool CompileGroup(IResourceGroup group)
371
372
372
373
var populateBuilder = classTypeDefinition == null ?
373
374
builder :
374
- typeSystem . CreateTypeBuilder ( classTypeDefinition ) ;
375
+ typeSystem . CreateTypeBuilder ( classTypeDefinition , compilerGeneratedType : false ) ; // don't add CompilerGeneratedAttribute to the user's type
375
376
376
377
( ( List < XamlDocumentResource > ) parsedXamlDocuments ) . Add ( new XamlDocumentResource (
377
378
parsed , res . Uri , res , classType ,
@@ -474,6 +475,7 @@ bool CompileGroup(IResourceGroup group)
474
475
var designLoaderField = new FieldDefinition ( "!XamlIlPopulateOverride" ,
475
476
FieldAttributes . Static | FieldAttributes . Private , designLoaderFieldTypeReference ) ;
476
477
classTypeDefinition . Fields . Add ( designLoaderField ) ;
478
+ typeSystem . AddCompilerGeneratedAttribute ( designLoaderField ) ;
477
479
478
480
const string TrampolineName = "!XamlIlPopulateTrampoline" ;
479
481
var trampolineMethodWithoutSP = new Lazy < MethodDefinition > ( ( ) => CreateTrampolineMethod ( false ) ) ;
@@ -489,6 +491,7 @@ MethodDefinition CreateTrampolineMethod(bool hasSystemProviderArg)
489
491
trampoline . Parameters . Add ( new ParameterDefinition ( classTypeDefinition ) ) ;
490
492
491
493
classTypeDefinition . Methods . Add ( trampoline ) ;
494
+ typeSystem . AddCompilerGeneratedAttribute ( trampoline ) ;
492
495
493
496
var regularStart = Instruction . Create ( OpCodes . Nop ) ;
494
497
0 commit comments