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.