Skip to content

Incorrect SYSLIB1102 error #94826

@JamesNK

Description

@JamesNK

Description

I updated grpc/grpc-dotnet to use .NET 8 SDK. A new error showed up in a project with <PublishTrimmed>true</PublishTrimmed>: SYSLIB1102

image

The description at https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1100-1118 says C# 11 or later is required. I verified my app is using C# 11:

<Target Name="WriteVersion" BeforeTargets="BeforeCompile">
  <Message Importance="High" Text="Version: $(LangVersion)" />
</Target>
Build started at 11:38 am...
1>------ Build started: Project: LinkerTestsWebsite, Configuration: Debug Any CPU ------
1>Version: 11.0
1>CSC(1,1,1,1): error SYSLIB1102: (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1102)
1>Done building project "LinkerTestsWebsite.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========
========== Build completed at 11:38 am and took 00.520 seconds ==========

The problem disappeared after I changed <LangVersion> to 12.0.

Reproduction Steps

See grpc/grpc-dotnet#2321

Change the version back to 11.0 to see the error.

Expected behavior

Either works with C# 11, or the warning correctly says C# 12 is required.

Actual behavior

Breaks with C# 11, and a warning says C# 11 or later is required.

Regression?

I think this regressed between .NET 8 RC1 and .NET 8 RTM (although I might not have been using the final version of RC1. It definitely worked during .NET 8 previews)

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions