Skip to content

[Housekeeping] Add ReferenceAssembliesExtensions extension for ReferenceAssemblies.Net.Net100#2956

Merged
TheCodeTraveler merged 3 commits intomainfrom
Add-Net100-as-Extension-for-ReferenceAssemblies
Nov 21, 2025
Merged

[Housekeeping] Add ReferenceAssembliesExtensions extension for ReferenceAssemblies.Net.Net100#2956
TheCodeTraveler merged 3 commits intomainfrom
Add-Net100-as-Extension-for-ReferenceAssemblies

Conversation

@TheCodeTraveler
Copy link
Collaborator

@TheCodeTraveler TheCodeTraveler commented Nov 20, 2025

Description of Change

This PR adds a temporary work-around for Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net100 as recommended in the Rosyln GitHub repo: dotnet/roslyn-sdk#1233 (comment)

using Microsoft.CodeAnalysis.Testing;

namespace CommunityToolkit.Maui.Analyzers.UnitTests;

static class ReferenceAssembliesExtensions
{
	static readonly Lazy<ReferenceAssemblies> lazyNet100 = new(() =>
		new(targetFramework: "net10.0",
			referenceAssemblyPackage: new PackageIdentity("Microsoft.NETCore.App.Ref", "10.0.0-rc.2.25502.107"),
			referenceAssemblyPath: Path.Combine("ref", "net10.0")));

	extension(ReferenceAssemblies.Net)
	{
		public static ReferenceAssemblies Net100 => lazyNet100.Value;
	}
}

PR Checklist

Additional information

This extension member will be removed once Microsoft publishes the next release of Microsoft.CodeAnalysis.CSharp.Analyzer.Testing to NuGet.

Microsoft.CodeAnalysis.Testing.ReferenceAssemblies.Net.Net100 was added to Microsoft.CodeAnalysis.CSharp.Analyzer.Testing in this PR: dotnet/roslyn-sdk#1221.

This PR also re-enables in build.yml the Run CommunityToolkit Analyzers UnitTests step.

@TheCodeTraveler TheCodeTraveler merged commit 1873607 into main Nov 21, 2025
11 checks passed
@TheCodeTraveler TheCodeTraveler deleted the Add-Net100-as-Extension-for-ReferenceAssemblies branch November 21, 2025 00:30
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants