Skip to content

Source Generators not working #4331

Open
@jamescrosswell

Description

@jamescrosswell

Description

As far as I can tell, the Sentry.SourceGenerators aren't working at all.

Steps to reproduce

  1. dotnet new console -f net9.0
  2. dotnet add package Sentry --version 5.11.2
  3. Copy/paste the following into program.cs
  4. dotnet run -c Debug
using Sentry.CompilerServices;

SentrySdk.Init();

string? buildConfig = null;
BuildProperties.Values?.TryGetValue("Configuration", out buildConfig);
if (buildConfig is null)
{
    Console.WriteLine("Source generators not working...");
}
else if (buildConfig == "Debug")
{
    Console.WriteLine("You're in Debug Mode");
}
else
{
    Console.WriteLine("You ain't in Debug Mode anymore Toto!");
}

Expected result

The application should output You're in Debug Mode.

Actual result

The application outputs Source generators not working...

Metadata

Metadata

Assignees

Labels

.NETPull requests that update .net codeBugSomething isn't workingRoslynThe .NET Compiler Platform, Roslyn Components and Extensions, Microsoft.CodeAnalysis

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions