Skip to content

Support Sentry.SourceGenerators via Visual Studio 2019 version 16.11 #4554

Open

Description

@KrzysztofFryzlewicz

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

When building UWP project using Azure DevOps Pipelines we got this error:

Error CS8032: An instance of analyzer Sentry.SourceGenerators.BuildPropertySourceGenerator cannot be created from C:\Users\svcprd_tfbuild.nuget\packages\sentry\5.15.1\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..

Microsoft.CodeAnalysis Version=4.3.0.0 is not available in Nuget repository.

Sentry Version=5.15.1

EDIT:
TreatWarningAsErrors is set to true, so this error is acutally a warning:
CSC : warning CS8032: An instance of analyzer Sentry.SourceGenerators.BuildPropertySourceGenerator cannot be created from C:\Users\svcprd_tfbuild.nuget\packages\sentry\5.14.1\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..

Expected Result

Build should finish without problems.

Actual Result

Build fails with error described above

Product Area

Unknown

Link

No response

DSN

No response

Version

No response

Activity

  1. linear commented on Sep 23, 2025

    @linear
  2. getsantry commented on Sep 23, 2025

    @getsantry

    Assigning to @getsentry/support for routing ⏲️

  3. moved this to Waiting for: Support in GitHub Issues with 👀 3on Sep 23, 2025
  4. transferred this issue fromgetsentry/sentryon Sep 23, 2025
  5. moved this from Waiting for: Support to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 23, 2025
  6. linear commented on Sep 23, 2025

    @linear
  7. added
    .NETPull requests that update .net code
    on Sep 23, 2025
  8. Flash0ver commented on Sep 23, 2025

    @Flash0ver
    Contributor

    Thanks @KrzysztofFryzlewicz for reporting this issue.

    One aspect that catches my eye is that you mentioned using v5.15.1 of the SDK,
    but the error contains \5.14.1\.
    Not sure if there is a restore issue, or just a message from a build before the version update.

    Anyway, we need a bit more info about the environment to reproduce the error:

    • which version of the .NET SDK / Visual Studio / MSBuild is used on your Azure Pipelines agent?

    I have the feeling that this is less of an UWP problem, but more of an issue related to compatibility with MSBuild and the available Roslyn Compiler version.

  9. KrzysztofFryzlewicz commented on Sep 23, 2025

    @KrzysztofFryzlewicz
    Author

    @Flash0ver yeah, issue exists in 5.14.1 and then I upgraded the package to see if this resolves anything, but no luck.
    MSBuild version: 16.0
    Visual Studio 2019

    We excluded this warning and build seems to run just fine.

  10. 8 remaining items

  11. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 23, 2025
  12. KrzysztofFryzlewicz commented on Sep 23, 2025

    @KrzysztofFryzlewicz
    Author

    I like the latter one, perfect!

  13. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Sep 23, 2025
  14. Flash0ver commented on Sep 23, 2025

    @Flash0ver
    Contributor

    We can close this issue, we did a workaround and it will probably resolve itself in the future. Thanks!

    I'd like to keep it open, at least for now, as we do indeed need to support building supported Projects from Visual Studio 16.11. May merge later into #4305.

  15. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Sep 23, 2025
  16. changed the title [-]UWP (.netstandard 2.0) fails to build[/-] [+]`Sentry.SourceGenerators` is not supported via Visual Studio 2019 version 16.11[/+] on Sep 23, 2025
  17. changed the title [-]`Sentry.SourceGenerators` is not supported via Visual Studio 2019 version 16.11[/-] [+]Support `Sentry.SourceGenerators` via Visual Studio 2019 version 16.11[/+] on Sep 23, 2025
  18. added and removed
    BugSomething isn't working
    on Sep 23, 2025
  19. self-assigned this
    on Sep 29, 2025
  20. Flash0ver commented on Sep 30, 2025

    @Flash0ver
    Contributor

    #4569 is now reporting this issue in CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeImprovement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions