Don't reference AssemblyMetadataAttribute in generated AssemblyInfo.cs when targeting net40
See original GitHub issueThe 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?)
https://github.com/dotnet/ef6/pull/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 https://github.com/dotnet/sdk/pull/11559 and could be fixed by not generating a reference to AssemblyMetadataAttribute when targeting net40.
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
No AssemblyInfo.cs file when generating a project in Visual ...
cs . Googling the issue I see that I can go to the project properties page and click the assembly information button and...
Read more >AssemblyInfo.cs not being generated automatically
There is no AssemblyInfo.cs generated based on the project properties, but rather the assembly information is automatically injected into ...
Read more >Adding AssemblyMetadataAttribute using new SDK project ...
Adding AssemblyMetadataAttribute using new SDK project, with MSBuild. Now that we have the new project system, and we can define common assembly ......
Read more >Change assemblyInfo from Pre-Build Event MSbuild
Hi, i try to change the assemblyInfo from Pre-build event but i can't access to info added in assemblyInfo.cs. i could change this...
Read more >How do I generate AssemblyInfo.cs in VS 2022?
I'm working on a .NET Core C# project and I need to add a line to the AssemblyInfo.cs file to make a Nuget...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sharwell It should be in preview 7
@clairernovotny We would use this URL to clone the sources when validating reproducibility. The info in the PDB does not include URL that can be cloned. It provides content URL pattern for each file. I guess another approach would be to fall back to downloading each file separately if the clone URL is not available. Less efficient, but perhaps ok as a fall back.