-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Description
After updating OpenTelemetry to .NET 10 preview 7, some of our projects fail to compile for due to the following error:
D:\Coding\open-telemetry\opentelemetry-dotnet\test\Benchmarks\obj\Debug\net462\Microsoft.Extensions.Logging.Generators\Microsoft.Extensions.Logging.Generators.LoggerMessageGenerator\LoggerMessage.g.cs(37,24): error CS0234: The type or namespace name 'FormattableString' does not exist in the namespace 'System.Diagnostics.CodeAnalysis' (are you missing an assembly reference?)
This appears to be due to this line of code that was added by #117009:
Line 180 in 7bc40a5
"global::System.Diagnostics.CodeAnalysis.FormattableString.Invariant("; |
I think it should be this?
- "global::System.Diagnostics.CodeAnalysis.FormattableString.Invariant("
+ "global::System.FormattableString.Invariant("
Reproduction Steps
- Clone open-telemetry/opentelemetry-dotnet@7487f44
- Run
dotnet build
from the root of the repository
Expected behavior
The solution compiles.
Actual behavior
Projects fail to compile due to CS0234
errors.
Regression?
Yes.
Known Workarounds
- Don't use the logging source generator
- Use fewer parameters to not enter the broken code block.
Configuration
.NET SDK 10.0.100-preview.7.25380.108
Other information
No response
slang25Copilot