From 1f64c432edbd16f949adeb713cd10fee312e70d7 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Thu, 2 Mar 2023 17:53:20 +0200 Subject: [PATCH 1/2] Added Mono.Cecil type forwarding --- .../ForwardingAttributes/Mono.Cecil.Mdb.cs | 29 +++ .../ForwardingAttributes/Mono.Cecil.Pdb.cs | 14 ++ .../ForwardingAttributes/Mono.Cecil.Rocks.cs | 14 ++ Harmony/ForwardingAttributes/Mono.Cecil.cs | 179 ++++++++++++++++++ 4 files changed, 236 insertions(+) create mode 100644 Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs create mode 100644 Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs create mode 100644 Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs create mode 100644 Harmony/ForwardingAttributes/Mono.Cecil.cs diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs new file mode 100644 index 00000000..3ba6f58d --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs @@ -0,0 +1,29 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFileException))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ISourceFile))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ICompileUnit))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.IMethodDef))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFile))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.OffsetTable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CodeBlockEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LocalVariableEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedVariable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedScope))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ScopeVariable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.AnonymousScopeEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CompileUnitEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceFileEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberTable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MethodEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.NamespaceEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolWriter))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceMethodBuilder))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SymbolWriterImpl))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbWriter))] +#endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs new file mode 100644 index 00000000..0cce5cf7 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs @@ -0,0 +1,14 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbWriter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.PdbReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.PdbWriterProvider))] +[assembly: TypeForwardedTo(typeof(Microsoft.Cci.ILocalScope))] +[assembly: TypeForwardedTo(typeof(Microsoft.Cci.INamespaceScope))] +[assembly: TypeForwardedTo(typeof(Microsoft.Cci.IUsedNamespace))] +[assembly: TypeForwardedTo(typeof(Microsoft.Cci.IName))] +#endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs new file mode 100644 index 00000000..75d3c0f0 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs @@ -0,0 +1,14 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.DocCommentId))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.IILVisitor))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ILParser))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.MethodBodyRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.MethodDefinitionRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ModuleDefinitionRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ParameterReferenceRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.SecurityDeclarationRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.TypeDefinitionRocks))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.TypeReferenceRocks))] +#endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.cs b/Harmony/ForwardingAttributes/Mono.Cecil.cs new file mode 100644 index 00000000..066459b4 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Cecil.cs @@ -0,0 +1,179 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.Collection<>))] +[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.ReadOnlyCollection<>))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayDimension))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyHashAlgorithm))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyLinkedResource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolveEventHandler))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolveEventArgs))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolutionException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.BaseAssemblyResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CallSite))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeArgument))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeNamedArgument))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ICustomAttribute))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttribute))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultAssemblyResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.EmbeddedResource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.EventReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ExportedType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FunctionPointerType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericInstanceMethod))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericInstanceType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IConstantProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ICustomAttributeProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IGenericInstance))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IGenericParameterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMarshalInfoProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMemberDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataScopeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataScope))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataTokenProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMethodSignature))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultReflectionImporter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultMetadataImporter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.LinkedResource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ManifestResourceAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayMarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomMarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.SafeArrayMarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FixedArrayMarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.FixedSysStringMarshalInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MemberReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IAssemblyResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResolutionException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodCallingConvention))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodImplAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReturnType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodSemanticsAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodSpecification))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IModifierType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.OptionalModifierType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.RequiredModifierType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReadingMode))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReaderParameters))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleParameters))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.WriterParameters))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetArchitecture))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleCharacteristics))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.NativeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PinnedType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeInfo))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PointerType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ByReferenceType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResourceType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Resource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAction))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ISecurityDeclarationProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAttribute))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityDeclaration))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.SentinelType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetRuntime))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.InterfaceImplementation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeSpecification))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeSystem))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.VariantType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataToken))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TokenType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Code))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentHashAlgorithm))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguage))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguageVendor))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Document))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandlerType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandler))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ILProcessor))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Instruction))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodBody))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.FlowControl))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OperandType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StackBehaviour))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCode))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbWriter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbWriter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SequencePoint))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugDirectory))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeaderEntry))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ScopeDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.InstructionOffset))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableIndex))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ConstantDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTargetKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTarget))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ICustomDebugInformationProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformationKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.BinaryCustomDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.AsyncMethodBodyDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StateMachineScope))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StateMachineScopeDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedSourceDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SourceLinkDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotFoundException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotMatchingException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DefaultSymbolReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DefaultSymbolWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableReference))] +#endif From 6aedda2d1d966e7bdb1fe97f2fc0018507710065 Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Thu, 16 Mar 2023 15:37:11 +0200 Subject: [PATCH 2/2] Manually set TypeForwardedTo Added net472 to redirect Mono.Cecil.GenericParameterConstraint Updated MonoMod.RuntimeDetour to be the same as Harmony v2.2.2 --- .../ForwardingAttributes/Mono.Cecil.Cil.cs | 45 ++++++ .../ForwardingAttributes/Mono.Cecil.Mdb.cs | 24 --- .../ForwardingAttributes/Mono.Cecil.Pdb.cs | 8 - .../ForwardingAttributes/Mono.Cecil.Rocks.cs | 6 - Harmony/ForwardingAttributes/Mono.Cecil.cs | 146 ++++-------------- .../Mono.Collections.Generic.cs | 5 + .../Mono.CompilerServices.SymbolWriter.cs | 18 +++ .../MonoMod.RuntimeDetour.Platforms.cs | 8 + .../MonoMod.RuntimeDetour.cs | 5 + .../ForwardingAttributes/MonoMod.Utils.Cil.cs | 6 + Harmony/ForwardingAttributes/MonoMod.Utils.cs | 11 ++ Harmony/Harmony.csproj | 4 +- 12 files changed, 126 insertions(+), 160 deletions(-) create mode 100644 Harmony/ForwardingAttributes/Mono.Cecil.Cil.cs create mode 100644 Harmony/ForwardingAttributes/Mono.Collections.Generic.cs create mode 100644 Harmony/ForwardingAttributes/Mono.CompilerServices.SymbolWriter.cs create mode 100644 Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.Platforms.cs create mode 100644 Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.cs create mode 100644 Harmony/ForwardingAttributes/MonoMod.Utils.Cil.cs create mode 100644 Harmony/ForwardingAttributes/MonoMod.Utils.cs diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Cil.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Cil.cs new file mode 100644 index 00000000..349ad9c7 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Cil.cs @@ -0,0 +1,45 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Code))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ConstantDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformationKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Document))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentHashAlgorithm))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguage))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguageVendor))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandler))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandlerType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.FlowControl))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ILProcessor))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugDirectory))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeaderEntry))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTarget))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTargetKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Instruction))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.InstructionOffset))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReader))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReaderProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodBody))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCode))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OperandType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ScopeDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SequencePoint))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StackBehaviour))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotFoundException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotMatchingException))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDebugInformation))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableReference))] +#endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs index 3ba6f58d..0ee46301 100644 --- a/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Mdb.cs @@ -1,29 +1,5 @@ #if NETFRAMEWORK using System.Runtime.CompilerServices; -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFileException))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ISourceFile))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ICompileUnit))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.IMethodDef))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFile))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.OffsetTable))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CodeBlockEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LocalVariableEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedVariable))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedScope))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ScopeVariable))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.AnonymousScopeEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CompileUnitEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceFileEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberTable))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MethodEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.NamespaceEntry))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolWriter))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceMethodBuilder))] -[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SymbolWriterImpl))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbReaderProvider))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbReader))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Mdb.MdbWriter))] #endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs index 0cce5cf7..54cb9426 100644 --- a/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Pdb.cs @@ -3,12 +3,4 @@ [assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbReader))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbWriter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.PdbReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.NativePdbWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Pdb.PdbWriterProvider))] -[assembly: TypeForwardedTo(typeof(Microsoft.Cci.ILocalScope))] -[assembly: TypeForwardedTo(typeof(Microsoft.Cci.INamespaceScope))] -[assembly: TypeForwardedTo(typeof(Microsoft.Cci.IUsedNamespace))] -[assembly: TypeForwardedTo(typeof(Microsoft.Cci.IName))] #endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs b/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs index 75d3c0f0..cf244900 100644 --- a/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs +++ b/Harmony/ForwardingAttributes/Mono.Cecil.Rocks.cs @@ -1,14 +1,8 @@ #if NETFRAMEWORK using System.Runtime.CompilerServices; -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.DocCommentId))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.IILVisitor))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ILParser))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.MethodBodyRocks))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.MethodDefinitionRocks))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ModuleDefinitionRocks))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.ParameterReferenceRocks))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.SecurityDeclarationRocks))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.TypeDefinitionRocks))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Rocks.TypeReferenceRocks))] #endif diff --git a/Harmony/ForwardingAttributes/Mono.Cecil.cs b/Harmony/ForwardingAttributes/Mono.Cecil.cs index 066459b4..e0b02208 100644 --- a/Harmony/ForwardingAttributes/Mono.Cecil.cs +++ b/Harmony/ForwardingAttributes/Mono.Cecil.cs @@ -1,27 +1,16 @@ #if NETFRAMEWORK using System.Runtime.CompilerServices; -[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.Collection<>))] -[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.ReadOnlyCollection<>))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayDimension))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyAttributes))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyHashAlgorithm))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyLinkedResource))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyNameReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolveEventHandler))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolveEventArgs))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.AssemblyResolutionException))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.BaseAssemblyResolver))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.CallSite))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttribute))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeArgument))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttributeNamedArgument))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ICustomAttribute))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomAttribute))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultAssemblyResolver))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.EmbeddedResource))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.EventAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.EventDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.EventReference))] @@ -29,41 +18,32 @@ [assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.FieldReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.FunctionPointerType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericInstanceMethod))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericInstanceType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameter))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterAttributes))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IConstantProvider))] +#if NET472 +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterConstraint))] +#endif +[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IAssemblyResolver))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ICustomAttributeProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IGenericInstance))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IGenericParameterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.GenericParameterType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMarshalInfoProvider))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IMemberDefinition))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataScopeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporter))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataResolver))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataScope))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataTokenProvider))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IMethodSignature))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataImporter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporterProvider))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.InterfaceImplementation))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultReflectionImporter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.DefaultMetadataImporter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.LinkedResource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.IReflectionImporterProvider))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ManifestResourceAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MarshalInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ArrayMarshalInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.CustomMarshalInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.SafeArrayMarshalInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.FixedArrayMarshalInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.FixedSysStringMarshalInfo))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MemberReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IAssemblyResolver))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IMetadataResolver))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResolutionException))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataResolver))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataScopeType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataToken))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodCallingConvention))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodDefinition))] @@ -71,109 +51,35 @@ [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReference))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodReturnType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodSemanticsAttributes))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MethodSpecification))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.IModifierType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.OptionalModifierType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.RequiredModifierType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReadingMode))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReaderParameters))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleParameters))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.WriterParameters))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleDefinition))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleKind))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataKind))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetArchitecture))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleCharacteristics))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleDefinition))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleKind))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleParameters))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ModuleReference))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.NativeType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.ParameterReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.PinnedType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.PInvokeInfo))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.PointerType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyDefinition))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.PropertyReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ByReferenceType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResourceType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReaderParameters))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ReadingMode))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResolutionException))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.Resource))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.ResourceType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAction))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.ISecurityDeclarationProvider))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityAttribute))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.SecurityDeclaration))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.SentinelType))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetArchitecture))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.TargetRuntime))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.TokenType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeAttributes))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeDefinition))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.InterfaceImplementation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataType))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeReference))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeSpecification))] [assembly: TypeForwardedTo(typeof(Mono.Cecil.TypeSystem))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.VariantType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.MetadataToken))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.TokenType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Code))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentHashAlgorithm))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguage))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DocumentLanguageVendor))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Document))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandlerType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ExceptionHandler))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ILProcessor))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.Instruction))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodBody))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.FlowControl))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodeType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OperandType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StackBehaviour))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCode))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.OpCodes))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbReader))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbReader))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.PortablePdbWriter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedPortablePdbWriter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SequencePoint))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugDirectory))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugType))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeader))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImageDebugHeaderEntry))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ScopeDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.InstructionOffset))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableAttributes))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableIndex))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ConstantDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTargetKind))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportTarget))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ImportDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ICustomDebugInformationProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformationKind))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.CustomDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.BinaryCustomDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.AsyncMethodBodyDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StateMachineScope))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.StateMachineScopeDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.EmbeddedSourceDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SourceLinkDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.MethodDebugInformation))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReader))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotFoundException))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.SymbolsNotMatchingException))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DefaultSymbolReaderProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriter))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.ISymbolWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.DefaultSymbolWriterProvider))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableDefinition))] -[assembly: TypeForwardedTo(typeof(Mono.Cecil.Cil.VariableReference))] +[assembly: TypeForwardedTo(typeof(Mono.Cecil.WriterParameters))] #endif diff --git a/Harmony/ForwardingAttributes/Mono.Collections.Generic.cs b/Harmony/ForwardingAttributes/Mono.Collections.Generic.cs new file mode 100644 index 00000000..f95db369 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.Collections.Generic.cs @@ -0,0 +1,5 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.Collections.Generic.Collection<>))] +#endif diff --git a/Harmony/ForwardingAttributes/Mono.CompilerServices.SymbolWriter.cs b/Harmony/ForwardingAttributes/Mono.CompilerServices.SymbolWriter.cs new file mode 100644 index 00000000..75c6b087 --- /dev/null +++ b/Harmony/ForwardingAttributes/Mono.CompilerServices.SymbolWriter.cs @@ -0,0 +1,18 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.AnonymousScopeEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedScope))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CapturedVariable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CodeBlockEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.CompileUnitEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LineNumberTable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.LocalVariableEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MethodEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.MonoSymbolFile))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.NamespaceEntry))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.OffsetTable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.ScopeVariable))] +[assembly: TypeForwardedTo(typeof(Mono.CompilerServices.SymbolWriter.SourceFileEntry))] +#endif diff --git a/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.Platforms.cs b/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.Platforms.cs new file mode 100644 index 00000000..f5207946 --- /dev/null +++ b/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.Platforms.cs @@ -0,0 +1,8 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform))] +[assembly: TypeForwardedTo(typeof(MonoMod.RuntimeDetour.Platforms.DetourRuntimeNETCore30Platform))] +[assembly: TypeForwardedTo(typeof(MonoMod.RuntimeDetour.Platforms.DetourRuntimeNETCorePlatform))] +[assembly: TypeForwardedTo(typeof(MonoMod.RuntimeDetour.Platforms.DetourRuntimeNETPlatform))] +#endif diff --git a/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.cs b/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.cs new file mode 100644 index 00000000..5bf91dfc --- /dev/null +++ b/Harmony/ForwardingAttributes/MonoMod.RuntimeDetour.cs @@ -0,0 +1,5 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(MonoMod.RuntimeDetour.OnMethodCompiledEvent))] +#endif diff --git a/Harmony/ForwardingAttributes/MonoMod.Utils.Cil.cs b/Harmony/ForwardingAttributes/MonoMod.Utils.Cil.cs new file mode 100644 index 00000000..6896a9dc --- /dev/null +++ b/Harmony/ForwardingAttributes/MonoMod.Utils.Cil.cs @@ -0,0 +1,6 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Cil.CecilILGenerator))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Cil.ILGeneratorShim))] +#endif diff --git a/Harmony/ForwardingAttributes/MonoMod.Utils.cs b/Harmony/ForwardingAttributes/MonoMod.Utils.cs new file mode 100644 index 00000000..00ba1e2d --- /dev/null +++ b/Harmony/ForwardingAttributes/MonoMod.Utils.cs @@ -0,0 +1,11 @@ +#if NETFRAMEWORK +using System.Runtime.CompilerServices; + +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DMDEmitDynamicMethodGenerator))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DMDGenerator<>))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.DynamicMethodDefinition))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Extensions))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.ICallSiteGenerator))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.ReflectionHelper))] +[assembly: TypeForwardedTo(typeof(MonoMod.Utils.Relinker))] +#endif diff --git a/Harmony/Harmony.csproj b/Harmony/Harmony.csproj index 1b9b7274..448925cc 100644 --- a/Harmony/Harmony.csproj +++ b/Harmony/Harmony.csproj @@ -1,7 +1,7 @@ - net35;net45;netstandard2.0 + net35;net45;net472;netstandard2.0; true HarmonyX BepInEx @@ -69,7 +69,7 @@ - +