Browse Source
Merge pull request #11363 from AvaloniaUI/fix-unnecessary-corelib-reference
Use TypeSystem.String instead of typeof(string) when resolving types from Cecil
pull/11340/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/Avalonia.Build.Tasks/XamlCompilerTaskExecutor.cs
|
|
|
@ -149,7 +149,7 @@ namespace Avalonia.Build.Tasks |
|
|
|
{ |
|
|
|
var ctor = asm.MainModule.ImportReference(typeSystem.GetTypeReference(asmMetadata).Resolve() |
|
|
|
.GetConstructors().First(c => c.Parameters.Count == 2).Resolve()); |
|
|
|
var strType = asm.MainModule.ImportReference(typeof(string)); |
|
|
|
var strType = asm.MainModule.TypeSystem.String; |
|
|
|
var arg1 = new CustomAttributeArgument(strType, "AvaloniaUseCompiledBindingsByDefault"); |
|
|
|
var arg2 = new CustomAttributeArgument(strType, defaultCompileBindings.ToString()); |
|
|
|
asm.CustomAttributes.Add(new CustomAttribute(ctor) { ConstructorArguments = { arg1, arg2 } }); |
|
|
|
|