Browse Source

Merge 7da058d3bf into c9f90082e6

pull/3946/merge
Jeremy Pritts 2 days ago committed by GitHub
parent
commit
2802403c19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj
  2. 2
      ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
  3. 2
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  4. 7
      ICSharpCode.Decompiler/DecompilerException.cs
  5. 4
      ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
  6. 4
      ICSharpCode.Decompiler/Documentation/XmlDocLoader.cs
  7. 8
      ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj
  8. 2
      ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs
  9. 6
      ICSharpCode.Decompiler/Metadata/EnumUnderlyingTypeResolveException.cs
  10. 39
      ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs
  11. 2
      ICSharpCode.Decompiler/NRTAttributes.cs
  12. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs
  13. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs
  14. 3
      ICSharpCode.Decompiler/TypeSystem/ReferenceResolvingException.cs
  15. 6
      ICSharpCode.Decompiler/TypeSystem/ReflectionNameParseException.cs
  16. 4
      ICSharpCode.Decompiler/Util/Index.cs
  17. 67
      ICSharpCode.Decompiler/packages.lock.json
  18. 1
      ICSharpCode.ILSpyCmd.Tests/ICSharpCode.ILSpyCmd.Tests.csproj
  19. 2
      ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj
  20. 2
      ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj
  21. 1
      ILSpy.BamlDecompiler.Tests.Windows/ILSpy.BamlDecompiler.Tests.Windows.csproj
  22. 1
      ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj
  23. 2
      ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
  24. 1
      ILSpy.Tests.Windows/ILSpy.Tests.Windows.csproj
  25. 1
      ILSpy.Tests/ILSpy.Tests.csproj
  26. 2
      ILSpy/ILSpy.csproj
  27. 2
      TestPlugin/TestPlugin.csproj

2
ICSharpCode.BamlDecompiler/ICSharpCode.BamlDecompiler.csproj

@ -73,7 +73,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences"> <Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences">

2
ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj

@ -18,7 +18,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -101,7 +101,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

7
ICSharpCode.Decompiler/DecompilerException.cs

@ -18,6 +18,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
@ -67,6 +68,9 @@ namespace ICSharpCode.Decompiler
} }
// This constructor is needed for serialization. // This constructor is needed for serialization.
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
protected DecompilerException(SerializationInfo info, StreamingContext context) : base(info, context) protected DecompilerException(SerializationInfo info, StreamingContext context) : base(info, context)
{ {
} }
@ -105,6 +109,9 @@ namespace ICSharpCode.Decompiler
return type; return type;
} }
#if NET5_0_OR_GREATER
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "All uses of the MethodInfo returned from frame.GetMethod() are null-checked.")]
#endif
static string GetStackTrace(Exception exception) static string GetStackTrace(Exception exception)
{ {
// Output stacktrace in custom format (very similar to Exception.StackTrace // Output stacktrace in custom format (very similar to Exception.StackTrace

4
ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs

@ -1276,6 +1276,7 @@ namespace ICSharpCode.Decompiler.Disassembler
{ FieldAttributes.Public, "public" }, { FieldAttributes.Public, "public" },
}; };
#pragma warning disable SYSLIB0050 // Type or member is obsolete
internal static readonly EnumNameCollection<FieldAttributes> fieldAttributes = new EnumNameCollection<FieldAttributes>() { internal static readonly EnumNameCollection<FieldAttributes> fieldAttributes = new EnumNameCollection<FieldAttributes>() {
{ FieldAttributes.Static, "static" }, { FieldAttributes.Static, "static" },
{ FieldAttributes.Literal, "literal" }, { FieldAttributes.Literal, "literal" },
@ -1284,6 +1285,7 @@ namespace ICSharpCode.Decompiler.Disassembler
{ FieldAttributes.RTSpecialName, "rtspecialname" }, { FieldAttributes.RTSpecialName, "rtspecialname" },
{ FieldAttributes.NotSerialized, "notserialized" }, { FieldAttributes.NotSerialized, "notserialized" },
}; };
#pragma warning restore SYSLIB0050 // Type or member is obsolete
public void DisassembleField(MetadataFile module, FieldDefinitionHandle handle) public void DisassembleField(MetadataFile module, FieldDefinitionHandle handle)
{ {
@ -1584,6 +1586,7 @@ namespace ICSharpCode.Decompiler.Disassembler
{ TypeAttributes.UnicodeClass, "unicode" }, { TypeAttributes.UnicodeClass, "unicode" },
}; };
#pragma warning disable SYSLIB0050 // Type or member is obsolete
internal static readonly EnumNameCollection<TypeAttributes> typeAttributes = new EnumNameCollection<TypeAttributes>() { internal static readonly EnumNameCollection<TypeAttributes> typeAttributes = new EnumNameCollection<TypeAttributes>() {
{ TypeAttributes.Abstract, "abstract" }, { TypeAttributes.Abstract, "abstract" },
{ TypeAttributes.Sealed, "sealed" }, { TypeAttributes.Sealed, "sealed" },
@ -1594,6 +1597,7 @@ namespace ICSharpCode.Decompiler.Disassembler
{ TypeAttributes.BeforeFieldInit, "beforefieldinit" }, { TypeAttributes.BeforeFieldInit, "beforefieldinit" },
{ TypeAttributes.HasSecurity, null }, { TypeAttributes.HasSecurity, null },
}; };
#pragma warning restore SYSLIB0050 // Type or member is obsolete
public void DisassembleType(MetadataFile module, TypeDefinitionHandle type) public void DisassembleType(MetadataFile module, TypeDefinitionHandle type)
{ {

4
ICSharpCode.Decompiler/Documentation/XmlDocLoader.cs

@ -19,6 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -36,6 +37,9 @@ namespace ICSharpCode.Decompiler.Documentation
static readonly Lazy<XmlDocumentationProvider> mscorlibDocumentation = new Lazy<XmlDocumentationProvider>(LoadMscorlibDocumentation); static readonly Lazy<XmlDocumentationProvider> mscorlibDocumentation = new Lazy<XmlDocumentationProvider>(LoadMscorlibDocumentation);
static readonly ConditionalWeakTable<MetadataFile, XmlDocumentationProvider> cache = new(); static readonly ConditionalWeakTable<MetadataFile, XmlDocumentationProvider> cache = new();
#if NET5_0_OR_GREATER
[UnconditionalSuppressMessage("SingleFile", "IL3000:Avoid accessing Assembly file path when publishing as a single file", Justification = $"'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. This is a valid input for {nameof(TryLoadModernRefPackDocumentation)}.")]
#endif
static XmlDocumentationProvider LoadMscorlibDocumentation() static XmlDocumentationProvider LoadMscorlibDocumentation()
{ {
string xmlDocFile = FindXmlDocumentation("mscorlib.dll", TargetRuntime.Net_4_0) string xmlDocFile = FindXmlDocumentation("mscorlib.dll", TargetRuntime.Net_4_0)

8
ICSharpCode.Decompiler/ICSharpCode.Decompiler.csproj

@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFrameworks>netstandard2.0;net10.0</TargetFrameworks>
<!-- Carry every distribution RID in the lock file so a RID-specific `dotnet publish -r <rid>` of a <!-- Carry every distribution RID in the lock file so a RID-specific `dotnet publish -r <rid>` of a
consuming app (ILSpy) restores in locked mode (RestoreLockedMode below) on any host OS, with no consuming app (ILSpy) restores in locked mode (RestoreLockedMode below) on any host OS, with no
per-publish restore escape hatch. Must match ILSpy.csproj's RuntimeIdentifiers. --> per-publish restore escape hatch. Must match ILSpy.csproj's RuntimeIdentifiers. -->
@ -80,6 +80,10 @@
</GetPackageVersionDependsOn> </GetPackageVersionDependsOn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
<IsAotCompatible>true</IsAotCompatible>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally> <ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
</PropertyGroup> </PropertyGroup>
@ -101,7 +105,7 @@
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" /> <PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" />
<!-- Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. --> <!-- Specifies the version of Microsoft.NETCore.App.Ref to obtain nullability information from. -->

2
ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs

@ -802,7 +802,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
var metadata = context.PEFile.Metadata; var metadata = context.PEFile.Metadata;
var moveNextMethod = metadata.GetTypeDefinition((TypeDefinitionHandle)stateMachineType.MetadataToken) var moveNextMethod = metadata.GetTypeDefinition((TypeDefinitionHandle)stateMachineType.MetadataToken)
.GetMethods().FirstOrDefault(f => metadata.GetString(metadata.GetMethodDefinition(f).Name) == "MoveNext"); .GetMethods().FirstOrDefault(f => metadata.GetString(metadata.GetMethodDefinition(f).Name) == "MoveNext");
if (moveNextMethod == null) if (moveNextMethod.IsNil)
throw new SymbolicAnalysisFailedException(); throw new SymbolicAnalysisFailedException();
moveNextFunction = YieldReturnDecompiler.CreateILAst(moveNextMethod, context); moveNextFunction = YieldReturnDecompiler.CreateILAst(moveNextMethod, context);
if (!(moveNextFunction.Body is BlockContainer blockContainer)) if (!(moveNextFunction.Body is BlockContainer blockContainer))

6
ICSharpCode.Decompiler/Metadata/EnumUnderlyingTypeResolveException.cs

@ -29,6 +29,9 @@ namespace ICSharpCode.Decompiler.Metadata
public EnumUnderlyingTypeResolveException() { } public EnumUnderlyingTypeResolveException() { }
public EnumUnderlyingTypeResolveException(string message) : base(message) { } public EnumUnderlyingTypeResolveException(string message) : base(message) { }
public EnumUnderlyingTypeResolveException(string message, Exception inner) : base(message, inner) { } public EnumUnderlyingTypeResolveException(string message, Exception inner) : base(message, inner) { }
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
protected EnumUnderlyingTypeResolveException( protected EnumUnderlyingTypeResolveException(
SerializationInfo info, SerializationInfo info,
StreamingContext context) : base(info, context) { } StreamingContext context) : base(info, context) { }
@ -40,6 +43,9 @@ namespace ICSharpCode.Decompiler.Metadata
public MetadataFileNotSupportedException() { } public MetadataFileNotSupportedException() { }
public MetadataFileNotSupportedException(string message) : base(message) { } public MetadataFileNotSupportedException(string message) : base(message) { }
public MetadataFileNotSupportedException(string message, Exception inner) : base(message, inner) { } public MetadataFileNotSupportedException(string message, Exception inner) : base(message, inner) { }
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
protected MetadataFileNotSupportedException( protected MetadataFileNotSupportedException(
SerializationInfo info, SerializationInfo info,
StreamingContext context) : base(info, context) { } StreamingContext context) : base(info, context) { }

39
ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs

@ -484,6 +484,16 @@ namespace ICSharpCode.Decompiler.Metadata
return path ?? version?.ToString() ?? "."; return path ?? version?.ToString() ?? ".";
} }
#if NET5_0_OR_GREATER
[UnconditionalSuppressMessage("SingleFile", "IL3002:Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file", Justification = "This method returns null when the module has no file path.")]
#endif
static string? GetSystemObjectModuleFullyQualifiedName()
{
// FullyQualifiedName returns "<Unknown>" for modules with no file path.
string? path = typeof(object).Module.FullyQualifiedName;
return path is "<Unknown>" ? null : path;
}
string? ResolveInternal(IAssemblyReference name) string? ResolveInternal(IAssemblyReference name)
{ {
if (name == null) if (name == null)
@ -494,12 +504,14 @@ namespace ICSharpCode.Decompiler.Metadata
return assembly; return assembly;
string[] framework_dirs; string[] framework_dirs;
string framework_dir; string? framework_dir;
switch (decompilerRuntime) switch (decompilerRuntime)
{ {
case DecompilerRuntime.Mono: case DecompilerRuntime.Mono:
framework_dir = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)!; framework_dir = Path.GetDirectoryName(GetSystemObjectModuleFullyQualifiedName());
if (string.IsNullOrEmpty(framework_dir))
goto NotFound;
framework_dirs = new[] { framework_dir, Path.Combine(framework_dir, "Facades") }; framework_dirs = new[] { framework_dir, Path.Combine(framework_dir, "Facades") };
break; break;
case DecompilerRuntime.NETCoreApp: case DecompilerRuntime.NETCoreApp:
@ -520,7 +532,9 @@ namespace ICSharpCode.Decompiler.Metadata
framework_dirs = new[] { framework_dir }; framework_dirs = new[] { framework_dir };
break; break;
default: default:
framework_dir = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)!; framework_dir = Path.GetDirectoryName(GetSystemObjectModuleFullyQualifiedName());
if (string.IsNullOrEmpty(framework_dir))
goto NotFound;
framework_dirs = new[] { framework_dir }; framework_dirs = new[] { framework_dir };
break; break;
} }
@ -560,12 +574,15 @@ namespace ICSharpCode.Decompiler.Metadata
// regardless of the requested version (the runtime itself rolls forward in the // regardless of the requested version (the runtime itself rolls forward in the
// same way). Without this, e.g. the type-forwards of a netstandard facade // same way). Without this, e.g. the type-forwards of a netstandard facade
// (pointing to a versioned System.Runtime) are unresolvable on such hosts. // (pointing to a versioned System.Runtime) are unresolvable on such hosts.
string runtimeDir = Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)!; string? runtimeDir = Path.GetDirectoryName(GetSystemObjectModuleFullyQualifiedName());
if (string.IsNullOrEmpty(runtimeDir))
goto NotFound;
assembly = SearchDirectory(name, runtimeDir); assembly = SearchDirectory(name, runtimeDir);
if (assembly != null) if (assembly != null)
return assembly; return assembly;
} }
NotFound:
if (throwOnError) if (throwOnError)
throw new ResolutionException(name, null, null); throw new ResolutionException(name, null, null);
return null; return null;
@ -631,7 +648,7 @@ namespace ICSharpCode.Decompiler.Metadata
if (decompilerRuntime != DecompilerRuntime.NETCoreApp) if (decompilerRuntime != DecompilerRuntime.NETCoreApp)
{ {
if (corlib.Version == version || IsSpecialVersionOrRetargetable(reference)) if (corlib.Version == version || IsSpecialVersionOrRetargetable(reference))
return typeof(object).Module.FullyQualifiedName; return GetSystemObjectModuleFullyQualifiedName();
} }
if (reference.PublicKeyToken == null) if (reference.PublicKeyToken == null)
@ -718,7 +735,10 @@ namespace ICSharpCode.Decompiler.Metadata
string? GetMonoMscorlibBasePath(Version version) string? GetMonoMscorlibBasePath(Version version)
{ {
var path = Directory.GetParent(typeof(object).Module.FullyQualifiedName)!.Parent!.FullName; string? corLibModulePath = GetSystemObjectModuleFullyQualifiedName();
if (corLibModulePath == null)
return null;
var path = Directory.GetParent(corLibModulePath)!.Parent!.FullName;
if (version.Major == 1) if (version.Major == 1)
path = Path.Combine(path, "1.0"); path = Path.Combine(path, "1.0");
else if (version.Major == 2) else if (version.Major == 2)
@ -779,11 +799,14 @@ namespace ICSharpCode.Decompiler.Metadata
return paths; return paths;
} }
static string GetCurrentMonoGac() static string? GetCurrentMonoGac()
{ {
string? corlibModulePath = GetSystemObjectModuleFullyQualifiedName();
if (string.IsNullOrEmpty(corlibModulePath))
return null;
return Path.Combine( return Path.Combine(
Directory.GetParent( Directory.GetParent(
Path.GetDirectoryName(typeof(object).Module.FullyQualifiedName)!)!.FullName, Path.GetDirectoryName(corlibModulePath)!)!.FullName,
"gac"); "gac");
} }

2
ICSharpCode.Decompiler/NRTAttributes.cs

@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements. // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
#if !NET5_0_OR_GREATER
namespace System.Diagnostics.CodeAnalysis namespace System.Diagnostics.CodeAnalysis
{ {
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
@ -23,3 +24,4 @@ namespace System.Diagnostics.CodeAnalysis
} }
} }
} }
#endif

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs

@ -147,11 +147,13 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
b.Add(KnownAttribute.FieldOffset, KnownTypeCode.Int32, offset); b.Add(KnownAttribute.FieldOffset, KnownTypeCode.Int32, offset);
} }
#pragma warning disable SYSLIB0050 // Type or member is obsolete
// NonSerializedAttribute // NonSerializedAttribute
if ((fieldDef.Attributes & FieldAttributes.NotSerialized) != 0) if ((fieldDef.Attributes & FieldAttributes.NotSerialized) != 0)
{ {
b.Add(KnownAttribute.NonSerialized); b.Add(KnownAttribute.NonSerialized);
} }
#pragma warning restore SYSLIB0050 // Type or member is obsolete
// SpecialName // SpecialName
if ((fieldDef.Attributes & (FieldAttributes.SpecialName | FieldAttributes.RTSpecialName)) == FieldAttributes.SpecialName) if ((fieldDef.Attributes & (FieldAttributes.SpecialName | FieldAttributes.RTSpecialName)) == FieldAttributes.SpecialName)

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataTypeDefinition.cs

@ -393,9 +393,11 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
var metadata = module.metadata; var metadata = module.metadata;
var typeDefinition = metadata.GetTypeDefinition(handle); var typeDefinition = metadata.GetTypeDefinition(handle);
#pragma warning disable SYSLIB0050 // Type or member is obsolete
// SerializableAttribute // SerializableAttribute
if ((typeDefinition.Attributes & TypeAttributes.Serializable) != 0) if ((typeDefinition.Attributes & TypeAttributes.Serializable) != 0)
b.Add(KnownAttribute.Serializable); b.Add(KnownAttribute.Serializable);
#pragma warning restore SYSLIB0050 // Type or member is obsolete
// ComImportAttribute // ComImportAttribute
if ((typeDefinition.Attributes & TypeAttributes.Import) != 0) if ((typeDefinition.Attributes & TypeAttributes.Import) != 0)

3
ICSharpCode.Decompiler/TypeSystem/ReferenceResolvingException.cs

@ -57,6 +57,9 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// </summary> /// </summary>
/// <param name="info">The object that holds the serialized object data.</param> /// <param name="info">The object that holds the serialized object data.</param>
/// <param name="context">The contextual information about the source or destination.</param> /// <param name="context">The contextual information about the source or destination.</param>
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
protected ReferenceResolvingException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) protected ReferenceResolvingException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context) : base(info, context)
{ {

6
ICSharpCode.Decompiler/TypeSystem/ReflectionNameParseException.cs

@ -49,11 +49,17 @@ namespace ICSharpCode.Decompiler.TypeSystem
} }
// This constructor is needed for serialization. // This constructor is needed for serialization.
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
protected ReflectionNameParseException(SerializationInfo info, StreamingContext context) : base(info, context) protected ReflectionNameParseException(SerializationInfo info, StreamingContext context) : base(info, context)
{ {
position = info.GetInt32("position"); position = info.GetInt32("position");
} }
#if NET5_0_OR_GREATER
[Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId = "SYSLIB0051", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
#endif
public override void GetObjectData(SerializationInfo info, StreamingContext context) public override void GetObjectData(SerializationInfo info, StreamingContext context)
{ {
base.GetObjectData(info, context); base.GetObjectData(info, context);

4
ICSharpCode.Decompiler/Util/Index.cs

@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements. // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license. // The .NET Foundation licenses this file to you under the MIT license.
#nullable enable #nullable enable
#if NETSTANDARD2_0
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
@ -163,4 +164,5 @@ namespace System
#endif #endif
} }
} }
} }
#endif

67
ICSharpCode.Decompiler/packages.lock.json

@ -116,6 +116,71 @@
".NETStandard,Version=v2.0/linux-x64": {}, ".NETStandard,Version=v2.0/linux-x64": {},
".NETStandard,Version=v2.0/osx-arm64": {}, ".NETStandard,Version=v2.0/osx-arm64": {},
".NETStandard,Version=v2.0/win-arm64": {}, ".NETStandard,Version=v2.0/win-arm64": {},
".NETStandard,Version=v2.0/win-x64": {} ".NETStandard,Version=v2.0/win-x64": {},
"net10.0": {
"Microsoft.CodeAnalysis.NetAnalyzers": {
"type": "Direct",
"requested": "[10.0.302, )",
"resolved": "10.0.302",
"contentHash": "mbJSf5EOYkgnPQ0jO0qo4AByQYDGbBZDs0+23xdkK2ckuvYJGlPT1nPR0WCSnzwXdiVypOTZ4ArcT4H/X/f1mQ=="
},
"Microsoft.NET.ILLink.Tasks": {
"type": "Direct",
"requested": "[10.0.9, )",
"resolved": "10.0.9",
"contentHash": "4Iw41e2h7I4t70SJcX2GCmbyKJIlA273Cfm9RJMM050/3VBejGAG1KcthP5Z2L6SQcbfbf6BhNWO26+ZG+GzMg=="
},
"Microsoft.Sbom.Targets": {
"type": "Direct",
"requested": "[4.1.5, )",
"resolved": "4.1.5",
"contentHash": "i5z+cNu/cOcdO0AgFB8aXk8w6In2H+haaDfSgd9ImvQIK+rSHavHZIogVoAZLL8jLwYx4bAcs5b7EyuMMG4mQQ=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
"requested": "[10.0.301, )",
"resolved": "10.0.301",
"contentHash": "S9U9Ye2bylMeDkzdNh+TsbRUNr6rkBORrnXDk45maPIxVvTmHV1SN2/qtZ/6yO7cdWmQv1LHv77yIeG6Q3nvMQ==",
"dependencies": {
"Microsoft.Build.Tasks.Git": "10.0.301",
"Microsoft.SourceLink.Common": "10.0.301",
"System.IO.Hashing": "10.0.10"
}
},
"System.Collections.Immutable": {
"type": "Direct",
"requested": "[9.0.0, )",
"resolved": "9.0.0",
"contentHash": "QhkXUl2gNrQtvPmtBTQHb0YsUrDiDQ2QS09YbtTTiSjGcf7NBqtYbrG/BE06zcBPCKEwQGzIv13IVdXNOSub2w=="
},
"System.Reflection.Metadata": {
"type": "Direct",
"requested": "[9.0.0, )",
"resolved": "9.0.0",
"contentHash": "ANiqLu3DxW9kol/hMmTWbt3414t9ftdIuiIU7j80okq2YzAueo120M442xk1kDJWtmZTqWQn7wHDvMRipVOEOQ=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "10.0.301",
"contentHash": "9Tah8f2BYuXlff9nIsJAeQJcqnijJTXNraIcTOF2f/f9kLmg0HNWPlMemnD6FBLd/UQcE0s9Vze2zCkA6nrZAA==",
"dependencies": {
"System.IO.Hashing": "10.0.10"
}
},
"Microsoft.SourceLink.Common": {
"type": "Transitive",
"resolved": "10.0.301",
"contentHash": "oz44EclJdAYVZcRb9dSbWd+6RaE+8a4j5zdE+O7yw5qPRZZhu3pcpDZ/Moy6pLeIXZqBP1FMd8CSE0sgJAGV0g=="
},
"System.IO.Hashing": {
"type": "Transitive",
"resolved": "10.0.10",
"contentHash": "eE839zyWZD/UBZYzP2lu9fhHX6RWe63/jz3Jxf+JumzO/db+Vc2s7CMiDwxk9ti2NTUft2tdRx31Rw2OjKbecA=="
}
},
"net10.0/linux-x64": {},
"net10.0/osx-arm64": {},
"net10.0/win-arm64": {},
"net10.0/win-x64": {}
} }
} }

1
ICSharpCode.ILSpyCmd.Tests/ICSharpCode.ILSpyCmd.Tests.csproj

@ -21,6 +21,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ICSharpCode.ILSpyCmd\ICSharpCode.ILSpyCmd.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyCmd\ICSharpCode.ILSpyCmd.csproj" />
</ItemGroup> </ItemGroup>

2
ICSharpCode.ILSpyCmd/ICSharpCode.ILSpyCmd.csproj

@ -54,7 +54,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" />
</ItemGroup> </ItemGroup>

2
ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj

@ -106,7 +106,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences"> <Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences">

1
ILSpy.BamlDecompiler.Tests.Windows/ILSpy.BamlDecompiler.Tests.Windows.csproj

@ -56,6 +56,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj" />
<ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

1
ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj

@ -40,6 +40,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

2
ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj

@ -34,7 +34,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj" /> <ProjectReference Include="..\ILSpy\ILSpy.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
</ItemGroup> </ItemGroup>

1
ILSpy.Tests.Windows/ILSpy.Tests.Windows.csproj

@ -59,6 +59,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ILSpy.Tests\ILSpy.Tests.csproj" /> <ProjectReference Include="..\ILSpy.Tests\ILSpy.Tests.csproj" />
<ProjectReference Include="..\ILSpy\ILSpy.csproj" /> <ProjectReference Include="..\ILSpy\ILSpy.csproj" />
</ItemGroup> </ItemGroup>

1
ILSpy.Tests/ILSpy.Tests.csproj

@ -42,6 +42,7 @@
</Target> </Target>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ILSpy\ILSpy.csproj" /> <ProjectReference Include="..\ILSpy\ILSpy.csproj" />
<!-- Build the sample plugin so the composition test has something to load, but DON'T copy <!-- Build the sample plugin so the composition test has something to load, but DON'T copy
Test.Plugin.dll into the test output: AppComposition scans *.Plugin.dll next to the test Test.Plugin.dll into the test output: AppComposition scans *.Plugin.dll next to the test

2
ILSpy/ILSpy.csproj

@ -127,7 +127,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
<ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj" />
</ItemGroup> </ItemGroup>

2
TestPlugin/TestPlugin.csproj

@ -8,7 +8,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ILSpy\ILSpy.csproj" /> <ProjectReference Include="..\ILSpy\ILSpy.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" SetTargetFramework="TargetFramework=netstandard2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save