Skip to content

Don't reference AssemblyMetadataAttribute in generated AssemblyInfo.cs when targeting net40 #11862

@halter73

Description

@halter73

The ef6 build targeting net40 failed recently with the following error after updating the .NET SDK to 5.0.100-preview.6.20266.3.

##[error]artifacts\obj\ef6\Release\net40\ef6.AssemblyInfo.cs(21,30): error CS0234: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'AssemblyMetadataAttribute' does not exist in the namespace 'System.Reflection' (are you missing an assembly reference?)

dotnet/ef6#1678

AssemblyMetadataAttribute doesn't exist in net40. ef6 has an AssemblyMetadataAttribute polyfill in some of its projects, but not the one that failed to build. Adding the polyfil works around the issue.

It looks like this is a regression introduced by #11559 and could be fixed by not generating a reference to AssemblyMetadataAttribute when targeting net40.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions