getsentry / getsentry/sentry-dotnet

Multi-target Roslyn Compiler Extensions

Open
#4,305 3 comments 0 reactions 1 assignee Claimed by @Flash0ver View on GitHub
.NET Improvement Roslyn
Dominant language
C#
Stars
770
Forks
248
Avg merge
3d 4h
Merged PRs (30d)
49

Description

### Description

We don't know under which environment the user is hosting Roslyn when building a project that depends on `Sentry`.
- .NET SDK version
- "Full"-Framework MSBuild
- custom Host

See https://github.com/dotnet/sdk/issues/20355

So that older hosts won't load the Roslyn Component, and newer hosts can choose a compatible version.

E.g. fixes issues like
```
An instance of analyzer Sentry.SourceGenerators.BuildPropertySourceGenerator cannot be created from {..}\.nuget\packages\sentry\5.11.0\analyzers\dotnet\cs\Sentry.SourceGenerators.dll : Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..
```

#### Examples
- [Microsoft.Extensions.Logging.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.