From 9a4525ca91119bedcca8fc3741d537ad9e41e2e9 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:02:49 +0100 Subject: [PATCH 1/7] Port to .NET 10 SDK and update dependencies - global.json: SDK 11 (roll forward, prerelease allowed); drop the pinned Microsoft.Net.Compilers.Toolset 3.4.0 in favor of the SDK compiler. - Annotate from Microsoft.NETCore.App.Ref 10.0.0; self-annotate with TunnelVisionLabs.ReferenceAssemblyAnnotator 1.0.0-alpha.160. - Update Mono.Cecil 0.11.6, StyleCop.Analyzers 1.2.0-beta.556, Nerdbank.GitVersioning 3.10.94. Compile the task against MSBuild 17.8.43 (compile-time only) so it still loads in SDK 8+ and VS 17.8+; MSBuild 18 would require System.Collections.Immutable 10. - Fix TypeReferenceEquivalenceComparer: Cecil's GetElementType() returns the innermost type, so by-ref/pointer/array element types lost their generic arguments (e.g. Nullable& matched Nullable&), which crashed annotation of net10.0 System.Runtime.InteropServices.JavaScript. - Nullable fixes for the newer compiler (as in #90). - WPF: only add NullableAttributes to _GeneratedCodeFiles when the markup compile project doesn't import package references (as in #90). - Tests: add net10.0 / net10.0-windows, WPF net40 -> net35, drop jnm2.ReferenceAssemblies.net35 (SDK provides net35 refs). Skip the explicit PackageDownload for netcoreapp3.x, where the SDK already downloads Microsoft.NETCore.App.Ref (NU1505). Silence EOL, NuGet audit and NETSDK1215 warnings in tests. No target frameworks were dropped. - Replace appveyor.yml with build/test.ps1 (-Engine dotnet|msbuild). Co-Authored-By: Claude Opus 5.5 --- Directory.Build.props | 13 +--- .../AnnotatorBuildTask.cs | 2 +- ...parers+TypeReferenceEquivalenceComparer.cs | 7 +- .../Program.cs | 6 +- ...sionLabs.ReferenceAssemblyAnnotator.csproj | 6 +- .../WindowsErrorCode.cs | 2 +- appveyor.yml | 78 ------------------- build/test.ps1 | 61 +++++++++++++++ global.json | 5 +- tests/Directory.Build.props | 9 +++ tests/MultiTFM/MultiTFM.csproj | 10 +-- .../NoDisabledWarnings.csproj | 10 +-- tests/RefVersion3.1.0/RefVersion3.1.0.csproj | 10 +-- tests/SingleTFM/SingleTFM.csproj | 8 +- tests/WPF/UserControl1.xaml | 11 +-- tests/WPF/WPF.csproj | 9 +-- 16 files changed, 105 insertions(+), 142 deletions(-) delete mode 100644 appveyor.yml create mode 100644 build/test.ps1 diff --git a/Directory.Build.props b/Directory.Build.props index 6eaa386..983d2e9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -29,26 +29,21 @@ $(MSBuildThisFileDirectory)build\Key.snk - - - - - enable - 3.1.0 + 10.0.0 false - + - + @@ -59,7 +54,7 @@ - + diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/AnnotatorBuildTask.cs b/TunnelVisionLabs.ReferenceAssemblyAnnotator/AnnotatorBuildTask.cs index f992064..1e157f0 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/AnnotatorBuildTask.cs +++ b/TunnelVisionLabs.ReferenceAssemblyAnnotator/AnnotatorBuildTask.cs @@ -74,7 +74,7 @@ public override bool Execute() { var log = new SuppressibleLoggingHelper(Log, requiredPrefix: "RA", DisabledWarnings); - string unannotatedReferenceAssembly = TargetFrameworkDirectories.Select(path => Path.Combine(path.ItemSpec, UnannotatedReferenceAssembly + ".dll")).FirstOrDefault(File.Exists); + string? unannotatedReferenceAssembly = TargetFrameworkDirectories.Select(path => Path.Combine(path.ItemSpec, UnannotatedReferenceAssembly + ".dll")).FirstOrDefault(File.Exists); string annotatedReferenceAssembly = Path.Combine(AnnotatedReferenceAssemblyDirectory, UnannotatedReferenceAssembly + ".dll"); bool foundAnnotatedAssembly = File.Exists(annotatedReferenceAssembly); diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/EquivalenceComparers+TypeReferenceEquivalenceComparer.cs b/TunnelVisionLabs.ReferenceAssemblyAnnotator/EquivalenceComparers+TypeReferenceEquivalenceComparer.cs index c539e92..63669bb 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/EquivalenceComparers+TypeReferenceEquivalenceComparer.cs +++ b/TunnelVisionLabs.ReferenceAssemblyAnnotator/EquivalenceComparers+TypeReferenceEquivalenceComparer.cs @@ -22,13 +22,14 @@ public bool Equals(TypeReference? x, TypeReference? y) if (x is null || y is null) return ReferenceEquals(x, y); + // GetElementType() returns the innermost type (dropping generic arguments), so compare ElementType. if (x.IsByReference) { - return y.IsByReference && Equals(x.GetElementType(), y.GetElementType()); + return y.IsByReference && Equals(((TypeSpecification)x).ElementType, ((TypeSpecification)y).ElementType); } else if (x.IsPointer) { - return y.IsPointer && Equals(x.GetElementType(), y.GetElementType()); + return y.IsPointer && Equals(((TypeSpecification)x).ElementType, ((TypeSpecification)y).ElementType); } else if (x.IsGenericInstance) { @@ -44,7 +45,7 @@ public bool Equals(TypeReference? x, TypeReference? y) return y.IsArray && xArray.Dimensions.SequenceEqual(((ArrayType)y).Dimensions, ArrayDimensionEqualityComparer.Instance) - && Equals(x.GetElementType(), y.GetElementType()); + && Equals(xArray.ElementType, ((ArrayType)y).ElementType); } if (x.IsNested) diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs b/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs index a79fc55..878d0c4 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs +++ b/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs @@ -287,7 +287,7 @@ private static bool IsExcludedAnnotation(ICustomAttributeProvider provider, ICus return annotatedTypeDefinition; } - private static MethodDefinition FindMatchingMethod(SuppressibleLoggingHelper? log, MethodDefinition methodDefinition, TypeDefinition annotatedTypeDefinition) + private static MethodDefinition? FindMatchingMethod(SuppressibleLoggingHelper? log, MethodDefinition methodDefinition, TypeDefinition annotatedTypeDefinition) { try { @@ -305,12 +305,12 @@ private static MethodDefinition FindMatchingMethod(SuppressibleLoggingHelper? lo } } - private static PropertyDefinition FindMatchingProperty(PropertyDefinition propertyDefinition, TypeDefinition annotatedTypeDefinition) + private static PropertyDefinition? FindMatchingProperty(PropertyDefinition propertyDefinition, TypeDefinition annotatedTypeDefinition) { return annotatedTypeDefinition.Properties.SingleOrDefault(property => EquivalenceComparers.PropertyDefinition.Equals(propertyDefinition, property)); } - private static FieldDefinition FindMatchingField(FieldDefinition fieldDefinition, TypeDefinition annotatedTypeDefinition) + private static FieldDefinition? FindMatchingField(FieldDefinition fieldDefinition, TypeDefinition annotatedTypeDefinition) { return annotatedTypeDefinition.Fields.SingleOrDefault(property => property.Name == fieldDefinition.Name); } diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj b/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj index 9322122..09e97b0 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj +++ b/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj @@ -17,9 +17,9 @@ - - - + + + diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs b/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs index 64e8d7d..a599cd0 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs +++ b/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs @@ -6,7 +6,7 @@ namespace TunnelVisionLabs.ReferenceAssemblyAnnotator internal enum WindowsErrorCode : ushort { /// - /// https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-#error_file_exists + /// See https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-#error_file_exists. /// FileExists = 80, } diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 26a6347..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,78 +0,0 @@ -version: '{build}' -image: Visual Studio 2019 -configuration: -- Debug -- Release -init: -- git config --global core.autocrlf true -before_build: -- nuget restore -skip_tags: true -build: - project: ReferenceAssemblyAnnotator.sln - verbosity: minimal -test_script: -- git clean -dxf tests -- msbuild /restore tests/MultiTFM /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/RefVersion3.1.0 /warnaserror /nr:false /v:m -- git clean -dxf tests -# No /warnaserror because WarningsNotAsErrors is not respected -- msbuild /restore tests/NoDisabledWarnings /p:TreatWarningsAsErrors=true /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=net35 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=net48 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netstandard1.6 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netstandard2.0 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netstandard2.1 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp1.0 /p:DisableImplicitNuGetFallbackFolder=true /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp1.1 /p:DisableImplicitNuGetFallbackFolder=true /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp2.0 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp2.1 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp3.0 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/SingleTFM /p:TestFramework=netcoreapp3.1 /warnaserror /nr:false /v:m -- git clean -dxf tests -- msbuild /restore tests/WPF /warnaserror /nr:false /v:m - -- git clean -dxf tests -- dotnet msbuild -restore tests/MultiTFM -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/RefVersion3.1.0 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/NoDisabledWarnings -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=net35 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=net48 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard1.6 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard2.0 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard2.1 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp1.0 -p:DisableImplicitNuGetFallbackFolder=true -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp1.1 -p:DisableImplicitNuGetFallbackFolder=true -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp2.0 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp2.1 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp3.0 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netcoreapp3.1 -warnaserror -nr:false -v:m -- git clean -dxf tests -- dotnet msbuild -restore tests/WPF -warnaserror -nr:false -v:m -artifacts: -- path: 'TunnelVisionLabs.ReferenceAssemblyAnnotator\**\*.nupkg' diff --git a/build/test.ps1 b/build/test.ps1 new file mode 100644 index 0000000..ec756ed --- /dev/null +++ b/build/test.ps1 @@ -0,0 +1,61 @@ +# Builds each sample project under tests/ against the locally built package. +# Run after building the solution with the same configuration. +param( + [string]$Configuration = 'Debug', + [ValidateSet('dotnet', 'msbuild')] + [string]$Engine = 'dotnet' +) + +$ErrorActionPreference = 'Stop' +$root = Split-Path $PSScriptRoot -Parent +$tests = Join-Path $root 'tests' + +# tests/NuGet.Config resolves the local package source through this variable. +$env:CONFIGURATION = $Configuration + +if ($Engine -eq 'msbuild') { + $msbuild = (Get-Command msbuild.exe -ErrorAction SilentlyContinue).Source + if (-not $msbuild) { + $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' + $msbuild = & $vswhere -latest -prerelease -requires Microsoft.Component.MSBuild -find 'MSBuild\**\Bin\MSBuild.exe' | Select-Object -First 1 + } + if (-not $msbuild) { throw 'msbuild.exe not found' } +} + +$singleTfms = 'net35', 'net48', 'netstandard1.6', 'netstandard2.0', 'netstandard2.1', + 'netcoreapp1.0', 'netcoreapp1.1', 'netcoreapp2.0', 'netcoreapp2.1', 'netcoreapp3.0', 'netcoreapp3.1', 'net10.0' + +$cases = @( + @{ Project = 'MultiTFM'; Args = @('-warnaserror') } + @{ Project = 'RefVersion3.1.0'; Args = @('-warnaserror') } + # -warnaserror ignores WarningsNotAsErrors, so this one uses the property instead. + @{ Project = 'NoDisabledWarnings'; Args = @('-p:TreatWarningsAsErrors=true') } +) +foreach ($tfm in $singleTfms) { + $cases += @{ Project = 'SingleTFM'; Args = @('-warnaserror', "-p:TestFramework=$tfm") } +} +foreach ($markup in 'false', 'true') { + $cases += @{ Project = 'WPF'; Args = @('-warnaserror', "-p:IncludePackageReferencesDuringMarkupCompilation=$markup") } +} + +$failed = @() +foreach ($case in $cases) { + $name = "$($case.Project) $($case.Args -join ' ')" + Write-Host "=== [$Engine] $name" -ForegroundColor Cyan + + # Start clean so the isolated package cache never serves a stale package. + git -C $root clean -dxfq -- tests + if ($LASTEXITCODE -ne 0) { throw 'git clean failed' } + + $buildArgs = @('-restore', (Join-Path $tests $case.Project), '-nr:false', '-v:m', "-p:Configuration=$Configuration") + $case.Args + if ($Engine -eq 'dotnet') { & dotnet msbuild @buildArgs } else { & $msbuild @buildArgs } + if ($LASTEXITCODE -ne 0) { $failed += $name } +} + +if ($failed.Count -gt 0) { + Write-Host "Failed ($($failed.Count)/$($cases.Count)):" -ForegroundColor Red + $failed | ForEach-Object { Write-Host " $_" -ForegroundColor Red } + exit 1 +} + +Write-Host "All $($cases.Count) test builds passed." -ForegroundColor Green diff --git a/global.json b/global.json index 0b2cf8a..e9c718d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,7 @@ { "sdk": { - "version": "3.1.100", - "rollForward": "latestFeature" + "version": "11.0.0", + "rollForward": "major", + "allowPrerelease": true } } diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 8c119d5..3ca9871 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -1,2 +1,11 @@ + + + + false + false + + $(MSBuildWarningsAsMessages);NETSDK1215 + + diff --git a/tests/MultiTFM/MultiTFM.csproj b/tests/MultiTFM/MultiTFM.csproj index eccd7a4..5906a81 100644 --- a/tests/MultiTFM/MultiTFM.csproj +++ b/tests/MultiTFM/MultiTFM.csproj @@ -1,7 +1,7 @@ - net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net10.0 8 enable RA1000 @@ -17,15 +17,11 @@ $(NoWarn),CS1701 - - - - - - + + diff --git a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj index f2c3148..034fc9e 100644 --- a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj +++ b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj @@ -1,7 +1,7 @@ - net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net10.0 8 enable RA1000 @@ -18,15 +18,11 @@ $(WarningsNotAsErrors),CS1701 - - - - - - + + diff --git a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj index 842c3ec..a9fa117 100644 --- a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj +++ b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj @@ -1,7 +1,7 @@ - net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1 + net35;net48;netstandard1.6;netstandard2.0;netstandard2.1;netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1;net10.0 8 enable RA1000 @@ -17,15 +17,11 @@ $(NoWarn),CS1701 - - - - - - + + diff --git a/tests/SingleTFM/SingleTFM.csproj b/tests/SingleTFM/SingleTFM.csproj index bcb0e5e..f68735a 100644 --- a/tests/SingleTFM/SingleTFM.csproj +++ b/tests/SingleTFM/SingleTFM.csproj @@ -12,15 +12,11 @@ $(NoWarn),CS1701 - - - - - - + + diff --git a/tests/WPF/UserControl1.xaml b/tests/WPF/UserControl1.xaml index 097d3c5..234aa26 100644 --- a/tests/WPF/UserControl1.xaml +++ b/tests/WPF/UserControl1.xaml @@ -1,12 +1,3 @@  - - - - + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"/> \ No newline at end of file diff --git a/tests/WPF/WPF.csproj b/tests/WPF/WPF.csproj index 755582f..0a52e01 100644 --- a/tests/WPF/WPF.csproj +++ b/tests/WPF/WPF.csproj @@ -1,9 +1,7 @@ - - net40;net48;netcoreapp3.0;netcoreapp3.1 + net35;net48;netcoreapp3.0;netcoreapp3.1;net10.0-windows true 8 enable @@ -11,9 +9,10 @@ - + - + + From cd0060989fdee0788349b803b85c249559925948 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:11:35 +0100 Subject: [PATCH 2/7] Rename to ICSharpCode.ReferenceAssemblyAnnotator and modernize packing - Rename project, folder, namespace, build props/targets and ruleset to ICSharpCode.ReferenceAssemblyAnnotator, so the package can be published to nuget.org under the new ID. - Remove the NewIdRequiredDueToNuGetBug PackageId workaround: the project no longer shares an ID with the published TunnelVisionLabs package it uses to annotate itself. - Package metadata modeled on ICSharpCode.Decompiler: ic#code / ILSpy Contributors, new repository URLs, packed README, tags; embedded PDBs with Source Link instead of a legacy symbols package; ContinuousIntegrationBuild on GitHub Actions. - Version line 2.0.0-preview.{height}. - tests/NuGet.Config: source mapping pins ICSharpCode.ReferenceAssemblyAnnotator to the local build output. - README and CLAUDE.md updated; remove codecov.yml (unused since AppVeyor). Validated by building ILSpy's ICSharpCode.Decompiler (nullable warnings as errors) against the new package. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 56 +++++++++++++++++++ .../CecilBasedAnnotator.csproj | 4 +- CecilBasedAnnotator/Program.cs | 2 +- .../Properties/launchSettings.json | 4 +- Directory.Build.props | 24 +++++--- ...arpCode.ReferenceAssemblyAnnotator.ruleset | 2 +- .../AnnotatorBuildTask.cs | 2 +- .../AssemblyResolver.cs | 2 +- .../CustomAttributeFactory.cs | 2 +- ...omparers+ArrayDimensionEqualityComparer.cs | 2 +- ...ers+MethodDefinitionEquivalenceComparer.cs | 2 +- ...ers+MethodReturnTypeEquivalenceComparer.cs | 2 +- ...+ParameterDefinitionEquivalenceComparer.cs | 2 +- ...s+PropertyDefinitionEquivalenceComparer.cs | 2 +- ...arers+TypeDefinitionEquivalenceComparer.cs | 2 +- ...parers+TypeReferenceEquivalenceComparer.cs | 2 +- .../EquivalenceComparers.cs | 2 +- ...harpCode.ReferenceAssemblyAnnotator.csproj | 18 ++---- ...SharpCode.ReferenceAssemblyAnnotator.props | 2 +- ...arpCode.ReferenceAssemblyAnnotator.targets | 2 +- .../MethodFactory.cs | 2 +- .../NullableAttributes.cs | 0 .../NullableAttributes.vb | 0 .../Program.cs | 2 +- .../Properties/AssemblyInfo.cs | 0 .../SuppressibleLoggingHelper.cs | 2 +- .../TypeDefinitionExtensions.cs | 2 +- ...ownTypes+AllowNullAttributeProvidedType.cs | 2 +- ...Types+DisallowNullAttributeProvidedType.cs | 2 +- ...ypes+DoesNotReturnAttributeProvidedType.cs | 2 +- ...es+DoesNotReturnIfAttributeProvidedType.cs | 2 +- ...nownTypes+EmbeddedAttributeProvidedType.cs | 2 +- ...ownTypes+MaybeNullAttributeProvidedType.cs | 2 +- ...ypes+MaybeNullWhenAttributeProvidedType.cs | 2 +- ...KnownTypes+NotNullAttributeProvidedType.cs | 2 +- ...s+NotNullIfNotNullAttributeProvidedType.cs | 2 +- ...nTypes+NotNullWhenAttributeProvidedType.cs | 2 +- ...nownTypes+NullableAttributeProvidedType.cs | 2 +- ...es+NullableContextAttributeProvidedType.cs | 2 +- ...NullablePublicOnlyAttributeProvidedType.cs | 2 +- .../WellKnownTypes+PredefinedType.cs | 2 +- .../WellKnownTypes+ProvidedAttributeType.cs | 2 +- .../WellKnownTypes+ProvidedType.cs | 2 +- ...+ReferenceAssemblyAttributeProvidedType.cs | 2 +- .../WellKnownTypes+WellKnownType.cs | 2 +- .../WellKnownTypes.cs | 2 +- .../WindowsErrorCode.cs | 2 +- README.md | 29 +++++----- ReferenceAssemblyAnnotator.sln | 2 +- codecov.yml | 25 --------- tests/MultiTFM/MultiTFM.csproj | 2 +- .../NoDisabledWarnings.csproj | 2 +- tests/NuGet.Config | 13 ++++- tests/RefVersion3.1.0/RefVersion3.1.0.csproj | 2 +- tests/SingleTFM/SingleTFM.csproj | 2 +- tests/WPF/WPF.csproj | 2 +- version.json | 2 +- 57 files changed, 151 insertions(+), 114 deletions(-) create mode 100644 CLAUDE.md rename TunnelVisionLabs.ReferenceAssemblyAnnotator.ruleset => ICSharpCode.ReferenceAssemblyAnnotator.ruleset (76%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/AnnotatorBuildTask.cs (98%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/AssemblyResolver.cs (97%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/CustomAttributeFactory.cs (98%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+ArrayDimensionEqualityComparer.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+MethodDefinitionEquivalenceComparer.cs (97%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+MethodReturnTypeEquivalenceComparer.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+ParameterDefinitionEquivalenceComparer.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+PropertyDefinitionEquivalenceComparer.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+TypeDefinitionEquivalenceComparer.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers+TypeReferenceEquivalenceComparer.cs (98%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/EquivalenceComparers.cs (95%) rename TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj => ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.csproj (69%) rename TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.props => ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.props (90%) rename TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets => ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets (98%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/MethodFactory.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/NullableAttributes.cs (100%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/NullableAttributes.vb (100%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/Program.cs (99%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/Properties/AssemblyInfo.cs (100%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/SuppressibleLoggingHelper.cs (97%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/TypeDefinitionExtensions.cs (91%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+AllowNullAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+DisallowNullAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+EmbeddedAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+MaybeNullAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NotNullAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NotNullWhenAttributeProvidedType.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NullableAttributeProvidedType.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NullableContextAttributeProvidedType.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs (95%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+PredefinedType.cs (92%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+ProvidedAttributeType.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+ProvidedType.cs (96%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes+WellKnownType.cs (94%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WellKnownTypes.cs (99%) rename {TunnelVisionLabs.ReferenceAssemblyAnnotator => ICSharpCode.ReferenceAssemblyAnnotator}/WindowsErrorCode.cs (88%) delete mode 100644 codecov.yml diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..cafc161 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,56 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What this is + +An IL weaver shipped as a NuGet package (`ICSharpCode.ReferenceAssemblyAnnotator`, the continuation of `TunnelVisionLabs.ReferenceAssemblyAnnotator`). At build time in a consuming project it takes un-annotated reference assemblies (.NET Framework, .NET Standard, .NET Core < 3.0) and copies nullability attributes onto them from the annotated `Microsoft.NETCore.App.Ref` package the consumer pulls via ``. The project then compiles against the annotated copies. + +## Build + +`global.json` selects the newest installed SDK 11 (prerelease allowed). Windows is required for the full test matrix (net35/net48, WPF, msbuild.exe). + +``` +dotnet build ReferenceAssemblyAnnotator.sln -c Release +``` + +- `GeneratePackageOnBuild` is on: the build writes the `.nupkg` to `ICSharpCode.ReferenceAssemblyAnnotator/bin//`. The version comes from Nerdbank.GitVersioning (`version.json`), so it only reflects committed changes. +- `TreatWarningsAsErrors` is on outside Visual Studio; StyleCop.Analyzers (`stylecop.json`) and `ICSharpCode.ReferenceAssemblyAnnotator.ruleset` apply. Assemblies are strong-name signed (`build/Key.snk`). +- The repo annotates its own references with the *published* `TunnelVisionLabs.ReferenceAssemblyAnnotator` (see `Directory.Build.props`), not the local build. +- The task targets netstandard2.0 (dotnet MSBuild) and net472 (VS MSBuild) and compiles against MSBuild 17.8 (compile-only). Don't raise that to MSBuild 18: it drags in System.Collections.Immutable 10, which older hosts can't load. + +## Tests + +There is no unit test project. The tests are sample projects under `tests/` that must build cleanly with warnings as errors against the locally built package. Build the solution first, then: + +``` +./build/test.ps1 -Configuration Release -Engine dotnet # dotnet msbuild +./build/test.ps1 -Configuration Release -Engine msbuild # VS msbuild.exe (found via vswhere) +``` + +The script runs `git clean -dxf tests` before every case, because `tests/NuGet.Config` uses an isolated package cache, and sets `CONFIGURATION` for that config's local source. Source mapping forces `ICSharpCode.ReferenceAssemblyAnnotator` to come from `ICSharpCode.ReferenceAssemblyAnnotator/bin/`. To run a single case by hand: + +``` +$env:CONFIGURATION='Release'; git clean -dxf tests +dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard2.0 -warnaserror -nr:false -v:m +``` + +- `tests/SingleTFM` is parameterized by `-p:TestFramework=` (net35 … net10.0); MultiTFM, RefVersion3.1.0, NoDisabledWarnings (uses `-p:TreatWarningsAsErrors=true`, since `-warnaserror` ignores `WarningsNotAsErrors`) and WPF cover the rest. +- For netcoreapp3.x the SDK already adds a `PackageDownload` of `Microsoft.NETCore.App.Ref`; a second one fails with NU1505, so the test projects leave out their own for those TFMs. + +CI: `.github/workflows/build.yml` runs the same build and test script and uploads the nupkg. + +## Architecture + +**MSBuild integration (most of the logic lives here)**: `ICSharpCode.ReferenceAssemblyAnnotator.props`/`.targets`, packed into `build/`. The file names must match the package ID. +- `.props` picks the task DLL: `tools/net472/` for full MSBuild, `tools/netstandard2.0/` for `dotnet` (Core) MSBuild. The Mono.Cecil DLLs are packed next to it via `_GetFilesToPackage`. +- `.targets` hooks `ResolveAssemblyReferencesDependsOn` with `AnnotateReferenceAssemblies` → `UpdateReferences`. It resolves the annotated source directory from the `Microsoft.NETCore.App.Ref` `PackageDownload` (errors RA0000–RA0002) and decides which references to annotate per target framework family: a hard-coded list for .NETFramework, framework-package references for .NETStandard/.NETCoreApp, and `ResolvedCompileFileDefinitionsToAdd` below 2.0. It writes the outputs to `$(IntermediateOutputPath)annotated\`, then swaps the `Reference` items and prepends that folder to `TargetFrameworkDirectory`. +- It also adds `NullableAttributes.cs`/`.vb` (internal copies of the nullable attributes) as `Compile` items unless the TFM already has them or `GenerateNullableAttributes=false`. The WPF `_GeneratedCodeFiles` line works around dotnet/wpf#810. + +**Weaver (C#)** in `ICSharpCode.ReferenceAssemblyAnnotator/`: +- `AnnotatorBuildTask`: the MSBuild task, invoked once per unannotated assembly; it calls `Program.Main`. +- `Program`: loads both assemblies with Mono.Cecil, walks types, methods, properties and fields, finds the matching member in the annotated assembly, and copies the nullability-related custom attributes. The `EquivalenceComparers+*` classes compare signatures structurally across different assembly identities; note that Cecil's `GetElementType()` returns the *innermost* type, so compare `TypeSpecification.ElementType` instead. It also makes sure the output carries `ReferenceAssemblyAttribute`. +- `WellKnownTypes` + `WellKnownTypes+*ProvidedType`: when the target assembly doesn't define an attribute type, it is synthesized into the output assembly as an internal embedded type via `CustomAttributeFactory`/`MethodFactory`. +- `SuppressibleLoggingHelper`: RA1xxx warnings that honor the consumer's `NoWarn`, which is passed in as `DisabledWarnings`. + +**`CecilBasedAnnotator`**: a small net472 console wrapper around `Program.Main` for debugging the weaver outside MSBuild. Arguments: ` `; sample profiles are in `Properties/launchSettings.json`. diff --git a/CecilBasedAnnotator/CecilBasedAnnotator.csproj b/CecilBasedAnnotator/CecilBasedAnnotator.csproj index cdc8e72..0848c0f 100644 --- a/CecilBasedAnnotator/CecilBasedAnnotator.csproj +++ b/CecilBasedAnnotator/CecilBasedAnnotator.csproj @@ -6,11 +6,11 @@ - ..\TunnelVisionLabs.ReferenceAssemblyAnnotator.ruleset + ..\ICSharpCode.ReferenceAssemblyAnnotator.ruleset - + diff --git a/CecilBasedAnnotator/Program.cs b/CecilBasedAnnotator/Program.cs index a4d924c..da36650 100644 --- a/CecilBasedAnnotator/Program.cs +++ b/CecilBasedAnnotator/Program.cs @@ -9,7 +9,7 @@ internal class Program { private static void Main(string[] args) { - TunnelVisionLabs.ReferenceAssemblyAnnotator.Program.Main( + ICSharpCode.ReferenceAssemblyAnnotator.Program.Main( log: null, referenceAssembly: args[0], targetFrameworkDirectories: args[1].Split(';').ToImmutableArray(), diff --git a/CecilBasedAnnotator/Properties/launchSettings.json b/CecilBasedAnnotator/Properties/launchSettings.json index fce9750..fc7ef20 100644 --- a/CecilBasedAnnotator/Properties/launchSettings.json +++ b/CecilBasedAnnotator/Properties/launchSettings.json @@ -2,11 +2,11 @@ "profiles": { "Microsoft.Win32.Primitives (netstandard1.6)": { "commandName": "Project", - "commandLineArgs": "\"$(NuGetPackageRoot)\\microsoft.win32.primitives\\4.3.0\\ref\\netstandard1.3\\Microsoft.Win32.Primitives.dll\" \"$(NuGetPackageRoot)\\microsoft.win32.primitives\\4.3.0\\ref\\netstandard1.3\\;$(NuGetPackageRoot)\\system.runtime\\4.3.0\\ref\\netstandard1.5\\\\\" \"$(NuGetPackageRoot)\\microsoft.netcore.app.ref\\3.0.0\\ref\\netcoreapp3.0\\Microsoft.Win32.Primitives.dll\" Microsoft.Win32.Primitives.dll" + "commandLineArgs": "\"$(NuGetPackageRoot)\\microsoft.win32.primitives\\4.3.0\\ref\\netstandard1.3\\Microsoft.Win32.Primitives.dll\" \"$(NuGetPackageRoot)\\microsoft.win32.primitives\\4.3.0\\ref\\netstandard1.3\\;$(NuGetPackageRoot)\\system.runtime\\4.3.0\\ref\\netstandard1.5\\\\\" \"$(NuGetPackageRoot)\\microsoft.netcore.app.ref\\10.0.0\\ref\\net10.0\\Microsoft.Win32.Primitives.dll\" Microsoft.Win32.Primitives.dll" }, "System.ComponentModel.DataAnnotations (netcoreapp2.0)": { "commandName": "Project", - "commandLineArgs": "\"$(NuGetPackageRoot)\\microsoft.netcore.app\\2.0.0\\ref\\netcoreapp2.0\\System.ComponentModel.DataAnnotations.dll\" \"$(NuGetPackageRoot)\\microsoft.netcore.app\\2.0.0\\ref\\netcoreapp2.0\\\\\" \"$(NuGetPackageRoot)\\microsoft.netcore.app.ref\\3.0.0\\ref\\netcoreapp3.0\\System.ComponentModel.DataAnnotations.dll\" System.ComponentModel.DataAnnotations.dll" + "commandLineArgs": "\"$(NuGetPackageRoot)\\microsoft.netcore.app\\2.0.0\\ref\\netcoreapp2.0\\System.ComponentModel.DataAnnotations.dll\" \"$(NuGetPackageRoot)\\microsoft.netcore.app\\2.0.0\\ref\\netcoreapp2.0\\\\\" \"$(NuGetPackageRoot)\\microsoft.netcore.app.ref\\10.0.0\\ref\\net10.0\\System.ComponentModel.DataAnnotations.dll\" System.ComponentModel.DataAnnotations.dll" } } } \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 983d2e9..0f26d75 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -59,18 +59,22 @@ IL weaver for adding nullability annotations to .NET Framework and .NET Standard reference assemblies. - TunnelVisionLabs.ReferenceAssemblyAnnotator - Tunnel Vision Laboratories, LLC - Copyright © Tunnel Vision Laboratories, LLC 2019 + ICSharpCode.ReferenceAssemblyAnnotator + ic#code + Copyright © Tunnel Vision Laboratories, LLC 2019; Copyright © ic#code $([System.DateTime]::Now.Year) en-US - sharwell - https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator + ILSpy Contributors + https://github.com/icsharpcode/ReferenceAssemblyAnnotator MIT - https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator + README.md + nullable;nullability;reference-assemblies;msbuild;il-weaver + https://github.com/icsharpcode/ReferenceAssemblyAnnotator.git git + true - true - true + + embedded + true + ..\tools\net472\ ..\tools\netstandard2.0\ diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets b/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets similarity index 98% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets rename to ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets index 10f60df..c41a31b 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TunnelVisionLabs.ReferenceAssemblyAnnotator.targets +++ b/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets @@ -1,7 +1,7 @@  - + <_FrameworkIncludesNullableAttributes Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' AND '$(TargetFrameworkVersion.Substring(1))' >= '3.0'">true diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/MethodFactory.cs b/ICSharpCode.ReferenceAssemblyAnnotator/MethodFactory.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/MethodFactory.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/MethodFactory.cs index abcd6a0..6c1c27e 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/MethodFactory.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/MethodFactory.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using Mono.Cecil; using Mono.Cecil.Cil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/NullableAttributes.cs b/ICSharpCode.ReferenceAssemblyAnnotator/NullableAttributes.cs similarity index 100% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/NullableAttributes.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/NullableAttributes.cs diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/NullableAttributes.vb b/ICSharpCode.ReferenceAssemblyAnnotator/NullableAttributes.vb similarity index 100% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/NullableAttributes.vb rename to ICSharpCode.ReferenceAssemblyAnnotator/NullableAttributes.vb diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs b/ICSharpCode.ReferenceAssemblyAnnotator/Program.cs similarity index 99% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/Program.cs index 878d0c4..d44503a 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/Program.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/Program.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using System.Collections.Generic; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/Properties/AssemblyInfo.cs b/ICSharpCode.ReferenceAssemblyAnnotator/Properties/AssemblyInfo.cs similarity index 100% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/Properties/AssemblyInfo.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/Properties/AssemblyInfo.cs diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs b/ICSharpCode.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs similarity index 97% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs index 0508f37..37f2930 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/SuppressibleLoggingHelper.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using System.Collections.Immutable; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs b/ICSharpCode.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs similarity index 91% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs index 47b5101..fbed44e 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/TypeDefinitionExtensions.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs index 74ae356..2cbefbe 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+AllowNullAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs index c9798e1..6bdf5b2 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DisallowNullAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs index bc51b5e..137bc9a 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs similarity index 95% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs index 9c9296b..0080994 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+DoesNotReturnIfAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs index 7d162bf..bb98df5 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+EmbeddedAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System.Linq; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs index c4f1e82..8b116e3 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs similarity index 95% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs index 5cd62b3..65712a6 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+MaybeNullWhenAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs index f62438e..d126a3f 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs similarity index 96% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs index 99b091e..aa9bdc2 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullIfNotNullAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs similarity index 95% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs index 1a73fca..fca54d6 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NotNullWhenAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs similarity index 96% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs index 5436896..58d6740 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System.Linq; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs similarity index 95% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs index 5bf5b78..a528078 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullableContextAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System.Linq; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs similarity index 95% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs index 0a47676..2c87ad0 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+NullablePublicOnlyAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System.Linq; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs similarity index 92% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs index c266e8e..69d9588 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+PredefinedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs similarity index 96% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs index 94b3d33..c842f2e 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedAttributeType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs similarity index 96% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs index a66d4ea..b5365bd 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs index 25090a9..bea0577 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+ReferenceAssemblyAttributeProvidedType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System.Linq; using System.Runtime.CompilerServices; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs similarity index 94% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs index 444511c..9d7c9db 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes+WellKnownType.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using Mono.Cecil; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes.cs similarity index 99% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes.cs index 58162e0..5993109 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WellKnownTypes.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WellKnownTypes.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { using System; using System.Runtime.CompilerServices; diff --git a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs b/ICSharpCode.ReferenceAssemblyAnnotator/WindowsErrorCode.cs similarity index 88% rename from TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs rename to ICSharpCode.ReferenceAssemblyAnnotator/WindowsErrorCode.cs index a599cd0..6995c1d 100644 --- a/TunnelVisionLabs.ReferenceAssemblyAnnotator/WindowsErrorCode.cs +++ b/ICSharpCode.ReferenceAssemblyAnnotator/WindowsErrorCode.cs @@ -1,7 +1,7 @@ // Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. -namespace TunnelVisionLabs.ReferenceAssemblyAnnotator +namespace ICSharpCode.ReferenceAssemblyAnnotator { internal enum WindowsErrorCode : ushort { diff --git a/README.md b/README.md index bb9cae6..fc56fc5 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,15 @@ -# Reference Assembly Annotator +# Reference Assembly Annotator IL weaver for adding nullability annotations to .NET Framework, .NET Standard, and .NET Core reference assemblies. -[![Build status](https://ci.appveyor.com/api/projects/status/pikrerggo7mi7dy5/branch/master?svg=true)](https://ci.appveyor.com/project/sharwell/referenceassemblyannotator/branch/master) +[![Build](https://github.com/icsharpcode/ReferenceAssemblyAnnotator/actions/workflows/build.yml/badge.svg)](https://github.com/icsharpcode/ReferenceAssemblyAnnotator/actions/workflows/build.yml) -[![codecov](https://codecov.io/gh/tunnelvisionlabs/ReferenceAssemblyAnnotator/branch/master/graph/badge.svg)](https://codecov.io/gh/tunnelvisionlabs/ReferenceAssemblyAnnotator) - -[![Join the chat at https://gitter.im/tunnelvisionlabs/ReferenceAssemblyAnnotator](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tunnelvisionlabs/ReferenceAssemblyAnnotator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +This is the continuation of [TunnelVisionLabs.ReferenceAssemblyAnnotator](https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator), +published as `ICSharpCode.ReferenceAssemblyAnnotator`. To migrate, replace the package ID; the MSBuild properties and items are unchanged. ## Requirements -* Build: C# compiler version 3.2 Beta 2 or newer (ships with Visual Studio 2019 version 16.3 Preview 2 and newer). Older - versions of the compiler interpret nullable metadata differently, which can lead to incorrect build warnings. -* Editing experience: Visual Studio 2019 version 16.3 Preview 2 or newer. +* Build: .NET SDK 8 or newer, or Visual Studio 2022 version 17.8 or newer. ## Usage @@ -46,10 +43,10 @@ IL weaver for adding nullability annotations to .NET Framework, .NET Standard, a - + - + ``` @@ -57,8 +54,8 @@ Minimal: ```xml - - + + ``` @@ -72,8 +69,8 @@ Minimal: ## Releases -[![NuGet](https://img.shields.io/nuget/v/TunnelVisionLabs.ReferenceAssemblyAnnotator.svg)](https://www.nuget.org/packages/TunnelVisionLabs.ReferenceAssemblyAnnotator) [![NuGet Beta](https://img.shields.io/nuget/vpre/TunnelVisionLabs.ReferenceAssemblyAnnotator.svg)](https://www.nuget.org/packages/TunnelVisionLabs.ReferenceAssemblyAnnotator/absoluteLatest) +[![NuGet](https://img.shields.io/nuget/vpre/ICSharpCode.ReferenceAssemblyAnnotator.svg)](https://www.nuget.org/packages/ICSharpCode.ReferenceAssemblyAnnotator) -* [Binaries (NuGet)](https://www.nuget.org/packages/TunnelVisionLabs.ReferenceAssemblyAnnotator) -* [Release Notes](https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/releases) -* [License](https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/blob/master/LICENSE) +* [Binaries (NuGet)](https://www.nuget.org/packages/ICSharpCode.ReferenceAssemblyAnnotator) +* [Release Notes](https://github.com/icsharpcode/ReferenceAssemblyAnnotator/releases) +* [License](https://github.com/icsharpcode/ReferenceAssemblyAnnotator/blob/master/LICENSE) diff --git a/ReferenceAssemblyAnnotator.sln b/ReferenceAssemblyAnnotator.sln index 0b31d2c..9e64bdb 100644 --- a/ReferenceAssemblyAnnotator.sln +++ b/ReferenceAssemblyAnnotator.sln @@ -5,7 +5,7 @@ VisualStudioVersion = 16.0.29209.152 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CecilBasedAnnotator", "CecilBasedAnnotator\CecilBasedAnnotator.csproj", "{802A569B-9ABD-43C2-8A4D-4E9946023A44}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TunnelVisionLabs.ReferenceAssemblyAnnotator", "TunnelVisionLabs.ReferenceAssemblyAnnotator\TunnelVisionLabs.ReferenceAssemblyAnnotator.csproj", "{8133EC1F-B531-4094-A76E-F155E4117D30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ReferenceAssemblyAnnotator", "ICSharpCode.ReferenceAssemblyAnnotator\ICSharpCode.ReferenceAssemblyAnnotator.csproj", "{8133EC1F-B531-4094-A76E-F155E4117D30}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{51FA6781-3E2C-4F33-9A73-D789899E93B6}" ProjectSection(SolutionItems) = preProject diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 4efdfca..0000000 --- a/codecov.yml +++ /dev/null @@ -1,25 +0,0 @@ -# https://docs.codecov.io/docs/codecov-yaml -# https://github.com/codecov/support/wiki/Codecov-Yaml - -coverage: - status: - project: - default: false - patch: - default: false - -comment: - layout: "diff" - -flags: - production: - paths: - - TunnelVisionLabs.ReferenceAssemblyAnnotator/ - test: - paths: - - TunnelVisionLabs.ReferenceAssemblyAnnotator.Test/ - # Filter results to only show debug reports until the accuracy problems with - # the report merge process are fixed. - Release: - paths: - - nonexistent/ diff --git a/tests/MultiTFM/MultiTFM.csproj b/tests/MultiTFM/MultiTFM.csproj index 5906a81..74d8567 100644 --- a/tests/MultiTFM/MultiTFM.csproj +++ b/tests/MultiTFM/MultiTFM.csproj @@ -19,7 +19,7 @@ - + diff --git a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj index 034fc9e..e2bcd6e 100644 --- a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj +++ b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj @@ -20,7 +20,7 @@ - + diff --git a/tests/NuGet.Config b/tests/NuGet.Config index 57336da..b99fbce 100644 --- a/tests/NuGet.Config +++ b/tests/NuGet.Config @@ -4,6 +4,17 @@ - + + + + + + + + + + + + diff --git a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj index a9fa117..dd16e16 100644 --- a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj +++ b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj @@ -19,7 +19,7 @@ - + diff --git a/tests/SingleTFM/SingleTFM.csproj b/tests/SingleTFM/SingleTFM.csproj index f68735a..c986873 100644 --- a/tests/SingleTFM/SingleTFM.csproj +++ b/tests/SingleTFM/SingleTFM.csproj @@ -14,7 +14,7 @@ - + diff --git a/tests/WPF/WPF.csproj b/tests/WPF/WPF.csproj index 0a52e01..af3ff10 100644 --- a/tests/WPF/WPF.csproj +++ b/tests/WPF/WPF.csproj @@ -10,7 +10,7 @@ - + diff --git a/version.json b/version.json index 1434c9a..dcf8337 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", - "version": "1.0.0-alpha.{height}", + "version": "2.0.0-preview.{height}", "assemblyVersion": { "precision": "minor" }, From 33411896f59b2832e7d47ab305670f359f0b28a9 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:11:53 +0100 Subject: [PATCH 3/7] Add GitHub Actions build: tests on both MSBuild engines, upload nupkg Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..410e152 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + branches: '**' + pull_request: + branches: [ master ] + +permissions: + contents: read + +jobs: + Build: + # net35/net48 and WPF test projects plus the msbuild.exe engine need Windows with Visual Studio. + runs-on: windows-2025-vs2026 + env: + Configuration: Release + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 # Nerdbank.GitVersioning needs the history + persist-credentials: false + + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: '11.0.x' + dotnet-quality: 'preview' + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v3 + + - name: Build and pack + run: dotnet build ReferenceAssemblyAnnotator.sln -c $env:Configuration + + - name: Test (dotnet msbuild) + run: ./build/test.ps1 -Configuration $env:Configuration -Engine dotnet + + - name: Test (msbuild.exe) + run: ./build/test.ps1 -Configuration $env:Configuration -Engine msbuild + + - name: Upload NuGet package + uses: actions/upload-artifact@v7 + with: + name: nuget-package + path: ICSharpCode.ReferenceAssemblyAnnotator/bin/${{ env.Configuration }}/*.nupkg + if-no-files-found: error From 5668b43a39f976942f50f70ff262e49596dd54f0 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:15:27 +0100 Subject: [PATCH 4/7] test.ps1: enable core.longpaths for git clean (CI checkout paths exceed MAX_PATH) Co-Authored-By: Claude Opus 5.5 --- build/test.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/test.ps1 b/build/test.ps1 index ec756ed..f38b51b 100644 --- a/build/test.ps1 +++ b/build/test.ps1 @@ -44,7 +44,8 @@ foreach ($case in $cases) { Write-Host "=== [$Engine] $name" -ForegroundColor Cyan # Start clean so the isolated package cache never serves a stale package. - git -C $root clean -dxfq -- tests + # longpaths: package cache paths exceed MAX_PATH on deep checkouts (e.g. GitHub runners). + git -C $root -c core.longpaths=true clean -dxfq -- tests if ($LASTEXITCODE -ne 0) { throw 'git clean failed' } $buildArgs = @('-restore', (Join-Path $tests $case.Project), '-nr:false', '-v:m', "-p:Configuration=$Configuration") + $case.Args From 5729b754637d191e19d9d5a218dbfac8e3c5b9df Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:23:46 +0100 Subject: [PATCH 5/7] CI: use a short NuGet packages path (msbuild.exe hits MAX_PATH) Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 410e152..e363a91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,9 @@ jobs: runs-on: windows-2025-vs2026 env: Configuration: Release + # The in-repo isolated cache (tests/NuGet.Config) exceeds MAX_PATH under msbuild.exe on the runner's deep checkout path. + # One run only ever sees one annotator version, so a shared short-path cache is safe here. + NUGET_PACKAGES: ${{ github.workspace }}\..\p steps: - uses: actions/checkout@v6 From 71a08c2c76b4cb30bea89997ea952048646932e5 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 14:33:27 +0100 Subject: [PATCH 6/7] CLAUDE.md: document CI cache override and self-annotation caveat Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index cafc161..26b67ca 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -16,7 +16,7 @@ dotnet build ReferenceAssemblyAnnotator.sln -c Release - `GeneratePackageOnBuild` is on: the build writes the `.nupkg` to `ICSharpCode.ReferenceAssemblyAnnotator/bin//`. The version comes from Nerdbank.GitVersioning (`version.json`), so it only reflects committed changes. - `TreatWarningsAsErrors` is on outside Visual Studio; StyleCop.Analyzers (`stylecop.json`) and `ICSharpCode.ReferenceAssemblyAnnotator.ruleset` apply. Assemblies are strong-name signed (`build/Key.snk`). -- The repo annotates its own references with the *published* `TunnelVisionLabs.ReferenceAssemblyAnnotator` (see `Directory.Build.props`), not the local build. +- The repo annotates its own references with the *published* `TunnelVisionLabs.ReferenceAssemblyAnnotator` (see `Directory.Build.props`), not the local build. That old version still has the `GetElementType()` comparer bug fixed here. It only works because this repo's own TFMs never hit the bug, so switch to the published `ICSharpCode.*` package once it exists. - The task targets netstandard2.0 (dotnet MSBuild) and net472 (VS MSBuild) and compiles against MSBuild 17.8 (compile-only). Don't raise that to MSBuild 18: it drags in System.Collections.Immutable 10, which older hosts can't load. ## Tests @@ -38,7 +38,7 @@ dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard2.0 -warnase - `tests/SingleTFM` is parameterized by `-p:TestFramework=` (net35 … net10.0); MultiTFM, RefVersion3.1.0, NoDisabledWarnings (uses `-p:TreatWarningsAsErrors=true`, since `-warnaserror` ignores `WarningsNotAsErrors`) and WPF cover the rest. - For netcoreapp3.x the SDK already adds a `PackageDownload` of `Microsoft.NETCore.App.Ref`; a second one fails with NU1505, so the test projects leave out their own for those TFMs. -CI: `.github/workflows/build.yml` runs the same build and test script and uploads the nupkg. +CI: `.github/workflows/build.yml` runs the same build and test script with both engines (Release only) and uploads the nupkg. On the runner, paths in the isolated cache exceed MAX_PATH under `msbuild.exe`. So the workflow sets `NUGET_PACKAGES` to a short path, which overrides `globalPackagesFolder`; that is safe because a run only ever contains one annotator version. `test.ps1` also passes `core.longpaths=true` to `git clean`. ## Architecture From 4b2d45be8e2d9d3ff2d6ca7d8ad8a726a8e175bd Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Sun, 8 Nov 2026 16:11:42 +0100 Subject: [PATCH 7/7] Fix review findings: skip .NET Core 3.0+, Linux test restore, cache isolation - Targets: don't annotate .NETCoreApp >= 3.0. Those reference assemblies are already annotated, and the Microsoft.NETCore.App.Ref PackageDownload the annotator requires can't be declared reliably there: when the targeting pack isn't installed the SDK adds its own download (NU1505 on a duplicate), and when it is installed, leaving it out failed with RA0000. This drops the GetHashCode [DisallowNull] removal and the annotation refresh for those TFMs (netcoreapp3.x is EOL). The test sources make that line conditional; the README explains how to condition the PackageDownload when multi-targeting. - tests/NuGet.Config: forward slashes in the local source path. With backslashes, package source mapping doesn't match that source on Linux/macOS and restore fails with NU1100. - test.ps1: set NUGET_PACKAGES explicitly (-PackagesPath, default tests/.isolatednugetcache). An inherited NUGET_PACKAGES overrides globalPackagesFolder, so a machine-wide cache served a stale annotator package with the same version. CI passes its short path through it. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 8 ++++---- CLAUDE.md | 13 +++++++------ .../ICSharpCode.ReferenceAssemblyAnnotator.targets | 5 ++++- README.md | 11 ++++++++++- build/test.ps1 | 10 +++++++++- tests/MultiTFM/Class1.cs | 4 ++++ tests/MultiTFM/MultiTFM.csproj | 5 +++-- tests/NoDisabledWarnings/Class1.cs | 4 ++++ tests/NoDisabledWarnings/NoDisabledWarnings.csproj | 5 +++-- tests/NuGet.Config | 3 ++- tests/RefVersion3.1.0/Class1.cs | 4 ++++ tests/RefVersion3.1.0/RefVersion3.1.0.csproj | 5 +++-- tests/SingleTFM/Class1.cs | 4 ++++ tests/SingleTFM/SingleTFM.csproj | 5 +++-- tests/WPF/UserControl1.xaml.cs | 4 ++++ tests/WPF/WPF.csproj | 5 +++-- 16 files changed, 71 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e363a91..3a8aeea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,9 @@ jobs: runs-on: windows-2025-vs2026 env: Configuration: Release - # The in-repo isolated cache (tests/NuGet.Config) exceeds MAX_PATH under msbuild.exe on the runner's deep checkout path. + # The in-repo isolated test cache exceeds MAX_PATH under msbuild.exe on the runner's deep checkout path. # One run only ever sees one annotator version, so a shared short-path cache is safe here. - NUGET_PACKAGES: ${{ github.workspace }}\..\p + TestPackages: ${{ github.workspace }}\..\p steps: - uses: actions/checkout@v6 @@ -37,10 +37,10 @@ jobs: run: dotnet build ReferenceAssemblyAnnotator.sln -c $env:Configuration - name: Test (dotnet msbuild) - run: ./build/test.ps1 -Configuration $env:Configuration -Engine dotnet + run: ./build/test.ps1 -Configuration $env:Configuration -Engine dotnet -PackagesPath $env:TestPackages - name: Test (msbuild.exe) - run: ./build/test.ps1 -Configuration $env:Configuration -Engine msbuild + run: ./build/test.ps1 -Configuration $env:Configuration -Engine msbuild -PackagesPath $env:TestPackages - name: Upload NuGet package uses: actions/upload-artifact@v7 diff --git a/CLAUDE.md b/CLAUDE.md index 26b67ca..27b842b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## What this is -An IL weaver shipped as a NuGet package (`ICSharpCode.ReferenceAssemblyAnnotator`, the continuation of `TunnelVisionLabs.ReferenceAssemblyAnnotator`). At build time in a consuming project it takes un-annotated reference assemblies (.NET Framework, .NET Standard, .NET Core < 3.0) and copies nullability attributes onto them from the annotated `Microsoft.NETCore.App.Ref` package the consumer pulls via ``. The project then compiles against the annotated copies. +An IL weaver shipped as a NuGet package (`ICSharpCode.ReferenceAssemblyAnnotator`, the continuation of `TunnelVisionLabs.ReferenceAssemblyAnnotator`). At build time in a consuming project it takes un-annotated reference assemblies (.NET Framework, .NET Standard, .NET Core < 3.0; .NET Core 3.0+ is skipped because it is already annotated) and copies nullability attributes onto them from the annotated `Microsoft.NETCore.App.Ref` package the consumer pulls via ``. The project then compiles against the annotated copies. ## Build @@ -28,23 +28,24 @@ There is no unit test project. The tests are sample projects under `tests/` that ./build/test.ps1 -Configuration Release -Engine msbuild # VS msbuild.exe (found via vswhere) ``` -The script runs `git clean -dxf tests` before every case, because `tests/NuGet.Config` uses an isolated package cache, and sets `CONFIGURATION` for that config's local source. Source mapping forces `ICSharpCode.ReferenceAssemblyAnnotator` to come from `ICSharpCode.ReferenceAssemblyAnnotator/bin/`. To run a single case by hand: +The script sets `NUGET_PACKAGES` to the isolated cache `tests/.isolatednugetcache` (an inherited machine-wide `NUGET_PACKAGES` would override `globalPackagesFolder` and serve a stale package with the same version), runs `git clean -dxf tests` before every case, and sets `CONFIGURATION` for the local source in `tests/NuGet.Config`. Source mapping forces `ICSharpCode.ReferenceAssemblyAnnotator` to come from `ICSharpCode.ReferenceAssemblyAnnotator/bin/`. To run a single case by hand: ``` -$env:CONFIGURATION='Release'; git clean -dxf tests +$env:CONFIGURATION='Release'; $env:NUGET_PACKAGES="$PWD\tests\.isolatednugetcache"; git clean -dxf tests dotnet msbuild -restore tests/SingleTFM -p:TestFramework=netstandard2.0 -warnaserror -nr:false -v:m ``` - `tests/SingleTFM` is parameterized by `-p:TestFramework=` (net35 … net10.0); MultiTFM, RefVersion3.1.0, NoDisabledWarnings (uses `-p:TreatWarningsAsErrors=true`, since `-warnaserror` ignores `WarningsNotAsErrors`) and WPF cover the rest. -- For netcoreapp3.x the SDK already adds a `PackageDownload` of `Microsoft.NETCore.App.Ref`; a second one fails with NU1505, so the test projects leave out their own for those TFMs. +- The test projects leave out the `Microsoft.NETCore.App.Ref` `PackageDownload` for .NET Core 3.0+ (netcoreapp3.x, net10.0). Those aren't annotated, and the SDK adds its own download whenever the targeting pack isn't installed, so a second one fails with NU1505. The `GetHashCode` line in the test sources is `#if !NETCOREAPP3_0_OR_GREATER` because only annotated TFMs get `[DisallowNull]` removed (`Program.IsExcludedAnnotation`). +- Keep the local source path in `tests/NuGet.Config` with forward slashes: with backslashes, source mapping doesn't match it on Linux/macOS (NU1100). -CI: `.github/workflows/build.yml` runs the same build and test script with both engines (Release only) and uploads the nupkg. On the runner, paths in the isolated cache exceed MAX_PATH under `msbuild.exe`. So the workflow sets `NUGET_PACKAGES` to a short path, which overrides `globalPackagesFolder`; that is safe because a run only ever contains one annotator version. `test.ps1` also passes `core.longpaths=true` to `git clean`. +CI: `.github/workflows/build.yml` runs the same build and test script with both engines (Release only) and uploads the nupkg. On the runner, paths in the isolated cache exceed MAX_PATH under `msbuild.exe`. So the workflow passes `-PackagesPath` with a short path outside the checkout; that cache isn't wiped between cases, which is safe because a run only ever contains one annotator version. `test.ps1` also passes `core.longpaths=true` to `git clean`. ## Architecture **MSBuild integration (most of the logic lives here)**: `ICSharpCode.ReferenceAssemblyAnnotator.props`/`.targets`, packed into `build/`. The file names must match the package ID. - `.props` picks the task DLL: `tools/net472/` for full MSBuild, `tools/netstandard2.0/` for `dotnet` (Core) MSBuild. The Mono.Cecil DLLs are packed next to it via `_GetFilesToPackage`. -- `.targets` hooks `ResolveAssemblyReferencesDependsOn` with `AnnotateReferenceAssemblies` → `UpdateReferences`. It resolves the annotated source directory from the `Microsoft.NETCore.App.Ref` `PackageDownload` (errors RA0000–RA0002) and decides which references to annotate per target framework family: a hard-coded list for .NETFramework, framework-package references for .NETStandard/.NETCoreApp, and `ResolvedCompileFileDefinitionsToAdd` below 2.0. It writes the outputs to `$(IntermediateOutputPath)annotated\`, then swaps the `Reference` items and prepends that folder to `TargetFrameworkDirectory`. +- `.targets` hooks `ResolveAssemblyReferencesDependsOn` with `AnnotateReferenceAssemblies` → `UpdateReferences`, except for .NETCoreApp >= 3.0. It resolves the annotated source directory from the `Microsoft.NETCore.App.Ref` `PackageDownload` (errors RA0000–RA0002) and decides which references to annotate per target framework family: a hard-coded list for .NETFramework, framework-package references for .NETStandard/.NETCoreApp, and `ResolvedCompileFileDefinitionsToAdd` below 2.0. It writes the outputs to `$(IntermediateOutputPath)annotated\`, then swaps the `Reference` items and prepends that folder to `TargetFrameworkDirectory`. - It also adds `NullableAttributes.cs`/`.vb` (internal copies of the nullable attributes) as `Compile` items unless the TFM already has them or `GenerateNullableAttributes=false`. The WPF `_GeneratedCodeFiles` line works around dotnet/wpf#810. **Weaver (C#)** in `ICSharpCode.ReferenceAssemblyAnnotator/`: diff --git a/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets b/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets index c41a31b..8c085f0 100644 --- a/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets +++ b/ICSharpCode.ReferenceAssemblyAnnotator/ICSharpCode.ReferenceAssemblyAnnotator.targets @@ -23,7 +23,10 @@ - + + $(ResolveAssemblyReferencesDependsOn); AnnotateReferenceAssemblies; diff --git a/README.md b/README.md index fc56fc5..f60114e 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,18 @@ published as `ICSharpCode.ReferenceAssemblyAnnotator`. To migrate, replace the p * System.Xml.Linq * .NET Standard targets * All assemblies which are defined by the .NET Standard -* .NET Core targets +* .NET Core targets before 3.0 * All reference assemblies defined by .NET Core +.NET Core 3.0 and newer are not annotated: their reference assemblies already carry nullable annotations. Don't add the +`Microsoft.NETCore.App.Ref` `PackageDownload` for those target frameworks. The SDK may download that package itself, and +a second download fails restore with NU1505. When multi-targeting, condition it, for example: + +```xml + + +``` + ### Example configuration ```xml diff --git a/build/test.ps1 b/build/test.ps1 index f38b51b..51cccb1 100644 --- a/build/test.ps1 +++ b/build/test.ps1 @@ -3,7 +3,10 @@ param( [string]$Configuration = 'Debug', [ValidateSet('dotnet', 'msbuild')] - [string]$Engine = 'dotnet' + [string]$Engine = 'dotnet', + # NuGet packages folder for the test restores. Default: tests/.isolatednugetcache, wiped before every case. + # CI passes a short path outside the checkout instead (MAX_PATH under msbuild.exe); that is not wiped. + [string]$PackagesPath ) $ErrorActionPreference = 'Stop' @@ -13,6 +16,11 @@ $tests = Join-Path $root 'tests' # tests/NuGet.Config resolves the local package source through this variable. $env:CONFIGURATION = $Configuration +# Set NUGET_PACKAGES explicitly: an inherited value (e.g. a machine-wide cache) overrides globalPackagesFolder in +# tests/NuGet.Config, and would then serve a stale annotator package with the same version as the one just built. +if (-not $PackagesPath) { $PackagesPath = Join-Path $tests '.isolatednugetcache' } +$env:NUGET_PACKAGES = $PackagesPath + if ($Engine -eq 'msbuild') { $msbuild = (Get-Command msbuild.exe -ErrorAction SilentlyContinue).Source if (-not $msbuild) { diff --git a/tests/MultiTFM/Class1.cs b/tests/MultiTFM/Class1.cs index 3671b38..09b33d8 100644 --- a/tests/MultiTFM/Class1.cs +++ b/tests/MultiTFM/Class1.cs @@ -13,7 +13,11 @@ public static void M(SqlConnection connection, [AllowNull] string? x) x.ToString(); } +#if !NETCOREAPP3_0_OR_GREATER + // The annotator removes [DisallowNull] from EqualityComparer.GetHashCode. .NET Core 3.0+ is not annotated, + // so its own [DisallowNull] applies there. _ = EqualityComparer.Default.GetHashCode(x); +#endif } } } diff --git a/tests/MultiTFM/MultiTFM.csproj b/tests/MultiTFM/MultiTFM.csproj index 74d8567..c7deac3 100644 --- a/tests/MultiTFM/MultiTFM.csproj +++ b/tests/MultiTFM/MultiTFM.csproj @@ -20,8 +20,9 @@ - - + + diff --git a/tests/NoDisabledWarnings/Class1.cs b/tests/NoDisabledWarnings/Class1.cs index 3671b38..09b33d8 100644 --- a/tests/NoDisabledWarnings/Class1.cs +++ b/tests/NoDisabledWarnings/Class1.cs @@ -13,7 +13,11 @@ public static void M(SqlConnection connection, [AllowNull] string? x) x.ToString(); } +#if !NETCOREAPP3_0_OR_GREATER + // The annotator removes [DisallowNull] from EqualityComparer.GetHashCode. .NET Core 3.0+ is not annotated, + // so its own [DisallowNull] applies there. _ = EqualityComparer.Default.GetHashCode(x); +#endif } } } diff --git a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj index e2bcd6e..3e3ffb8 100644 --- a/tests/NoDisabledWarnings/NoDisabledWarnings.csproj +++ b/tests/NoDisabledWarnings/NoDisabledWarnings.csproj @@ -21,8 +21,9 @@ - - + + diff --git a/tests/NuGet.Config b/tests/NuGet.Config index b99fbce..c31846e 100644 --- a/tests/NuGet.Config +++ b/tests/NuGet.Config @@ -5,7 +5,8 @@ - + + diff --git a/tests/RefVersion3.1.0/Class1.cs b/tests/RefVersion3.1.0/Class1.cs index 3671b38..09b33d8 100644 --- a/tests/RefVersion3.1.0/Class1.cs +++ b/tests/RefVersion3.1.0/Class1.cs @@ -13,7 +13,11 @@ public static void M(SqlConnection connection, [AllowNull] string? x) x.ToString(); } +#if !NETCOREAPP3_0_OR_GREATER + // The annotator removes [DisallowNull] from EqualityComparer.GetHashCode. .NET Core 3.0+ is not annotated, + // so its own [DisallowNull] applies there. _ = EqualityComparer.Default.GetHashCode(x); +#endif } } } diff --git a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj index dd16e16..55ad3e9 100644 --- a/tests/RefVersion3.1.0/RefVersion3.1.0.csproj +++ b/tests/RefVersion3.1.0/RefVersion3.1.0.csproj @@ -20,8 +20,9 @@ - - + + diff --git a/tests/SingleTFM/Class1.cs b/tests/SingleTFM/Class1.cs index 3671b38..09b33d8 100644 --- a/tests/SingleTFM/Class1.cs +++ b/tests/SingleTFM/Class1.cs @@ -13,7 +13,11 @@ public static void M(SqlConnection connection, [AllowNull] string? x) x.ToString(); } +#if !NETCOREAPP3_0_OR_GREATER + // The annotator removes [DisallowNull] from EqualityComparer.GetHashCode. .NET Core 3.0+ is not annotated, + // so its own [DisallowNull] applies there. _ = EqualityComparer.Default.GetHashCode(x); +#endif } } } diff --git a/tests/SingleTFM/SingleTFM.csproj b/tests/SingleTFM/SingleTFM.csproj index c986873..a37e1ab 100644 --- a/tests/SingleTFM/SingleTFM.csproj +++ b/tests/SingleTFM/SingleTFM.csproj @@ -15,8 +15,9 @@ - - + + diff --git a/tests/WPF/UserControl1.xaml.cs b/tests/WPF/UserControl1.xaml.cs index fd690b9..4addbca 100644 --- a/tests/WPF/UserControl1.xaml.cs +++ b/tests/WPF/UserControl1.xaml.cs @@ -19,7 +19,11 @@ public static void M(SqlConnection connection, [AllowNull] string? x) x.ToString(); } +#if !NETCOREAPP3_0_OR_GREATER + // The annotator removes [DisallowNull] from EqualityComparer.GetHashCode. .NET Core 3.0+ is not annotated, + // so its own [DisallowNull] applies there. _ = EqualityComparer.Default.GetHashCode(x); +#endif } } } diff --git a/tests/WPF/WPF.csproj b/tests/WPF/WPF.csproj index af3ff10..4fb52cd 100644 --- a/tests/WPF/WPF.csproj +++ b/tests/WPF/WPF.csproj @@ -11,8 +11,9 @@ - - + +