Skip to content

Multi-target Roslyn Compiler Extensions #4305

@Flash0ver

Description

@Flash0ver

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 dotnet/sdk#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeImprovementRoslynThe .NET Compiler Platform, Roslyn Components and Extensions, Microsoft.CodeAnalysis

    Type

    No type

    Projects

    Status

    No status

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions