getsentry / getsentry/sentry-dotnet

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

Open Beginner friendly
#5,549 1 comment 0 reactions 0 assignees View on GitHub
.NET Task upstream-watch
Dominant language
C#
Stars
770
Forks
248
Avg merge
2d 22h
Merged PRs (30d)
51

Description

## 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

* .NET 11 support: #5527 / #5529
* Upstream: https://github.com/dotnet/roslyn-sdk

Contributor guide

Open the contributing guide

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.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.