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.

GenAPI outputs reference to internal type in assembly-level attribute

See original GitHub issue

When targeting System.Text.Json 6.0.0, GenAPI includes the following in its output:

[assembly: System.Reflection.Metadata.MetadataUpdateHandler(typeof(JsonSerializerOptionsUpdateHandler))]

This fails to compile because JsonSerializerOptionsUpdateHandler is an internal type and is not included in the generated code. Here’s what the actual source looks like: https://github.com/dotnet/runtime/blob/5f94bffeff62f4b767a311a4505d6d40d86279d9/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptionsUpdateHandler.cs#L11-L18

cc @ViktorHofer

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Reactions:2
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
andriipatsulacommented, Mar 9, 2023

We are checking attribute type System.Reflection.Metadata.MetadataUpdateHandler and not typeof(JsonSerializerOptionsUpdateHandler). We do not analyze attribute’s value.

0reactions
ViktorHofercommented, Mar 13, 2023

Submitted https://github.com/dotnet/sdk/issues/31098 to fix this. As mentioned above, the change follows what we were doing in the CCI based GenAPI. Internal attributes are already filtered out today in main. If we want to change that, we should discuss that in a separate issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to generate code using Roslyn source ...
The BuildOutputTargetFolder property means our assembly will end up in analyzers/netstandard2.0 inside the package, so it will not become a lib ...
Read more >
c# - How can I access an internal class from an external ...
Having an assembly which I cannot modify (vendor-supplied) which have a method returning an object type but is really of an internal type....
Read more >
MIPS Assembly Language Programming using QtSpim
The following diagram shows a basic configuration of the MIPS processor internal architecture. The FPU (floating-point unit) is also referred to as the...
Read more >
ABAQUS Analysis User's Manual (v6.6)
This section describes the methods for defining elements in an ABAQUS input file. In a preprocessor such as ABAQUS/CAE, you define the model...
Read more >
Assembly language
The use of symbolic references is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most ...
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