question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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?)

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:closed
  • Created 3 years ago
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
sfoslundcommented, Jul 1, 2020

@sharwell It should be in preview 7

1reaction
tmatcommented, Jun 15, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found