Use ReferenceAssemblies.Net.Net110 once Microsoft.CodeAnalysis.Testing ships it

Open Beginner friendly
#5,549 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp

Research direction

Start in test/Sentry.Compiler.Extensions.Tests/Testing/ReferenceAssembliesExtensions.cs and inspect the TODO at the call site. Confirm that the shipped Microsoft.CodeAnalysis.Testing package provides ReferenceAssemblies.Net.Net110, then remove the local declaration and hard-coded reference-pack version. Run the Sentry.Compiler.Extensions.Tests project to verify the analyzer tests pass.

Written by the indexing model from the issue text.

Description

.NET Task upstream-watch

Description

test/Sentry.Compiler.Extensions.Tests/Testing/ReferenceAssembliesExtensions.cs declares its own net11.0 ReferenceAssemblies entry, because Microsoft.CodeAnalysis.Testing doesn't ship one - the newest it has is Net100, in 1.1.3 and 1.1.4 alike.

Falling back to Net100 does not work: the analyzer test snippets reference a net11.0-built Sentry.dll, which pulls System.Runtime 11.0.0.0 and fails against .NET 10 reference assemblies:

error CS1705: Assembly 'Sentry' ... uses 'System.Runtime, Version=11.0.0.0' which has a
higher version than referenced assembly 'System.Runtime, Version=10.0.0.0'

So the local declaration pins Microsoft.NETCore.App.Ref to a specific preview version, which has to be kept in step with global.json on every SDK bump.

What to do

When the package ships ReferenceAssemblies.Net.Net110, delete the local declaration and use it, removing the hard-coded reference-pack version. There's a TODO at the call site.

Refs

Dominant language
C#
Stars
770
Forks
250
Avg merge
2d 17h
Merged PRs (30d)
61

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-dotnet

All issues in getsentry/sentry-dotnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.