bute-dependent" types
like ` dynamic ` , ` List<string?> ` , ` nint ` , and so on can't be fully
represented in the final IL for an attribute type argument, because there
isn't a symbol to "attach" the ` DynamicAttribute ` or other well-known
attribute to.

##  Drawbacks

Removing the restriction, reasoning out the implications, and adding the
appropriate tests is work.

##  Alternatives

Attribute authors who want users to be able to discover the requirements for
the types they provide to attributes need to write analyzers and guide their
users to use those analyzers in their builds.

##  Unresolved questions

  * [x] What does ` AllowMultiple = false ` mean on a generic attribute? If we have ` [Attr<string>] ` and ` [Attr<object>] ` both used on a symbol, does that mean "multiple" of the attribute are in use? 
    * For now we are inclined to take the more restrictive route here and consider the attribute class's original definition when deciding whether multiple of it have been applied. In other words, ` [Attr<string>] ` and ` [Attr<object>] ` applied together is incompatible with ` AllowMultiple = false ` . 

##  Design meetings

  * [ https://github.com/dotnet/csharplang/blob/main/meetings/2017/LDM-2017-02-21.md#generic-attributes ](https://github.com/dotnet/csharplang/blob/main/meetings/2017/LDM-2017-02-21.md#generic-attributes)
    * At the time there was a concern that we would have to gate the feature on whether the target runtime supports it. (However, we now only support C# 10 on .NET 6. It would be nice to for the implementation to be aware of what minimum target framework supports the feature, but seems less essential today.) 

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create
and review issues and pull requests. For more information, see [ our
contributor guide
](https://learn.microsoft.com/contribute/content/dotnet/dotnet-contribute) .

![](https://learn.microsoft.com/media/logos/logo_net.svg)
![](https://learn.microsoft.com/media/logos/logo_net.svg)

C# feature specifications

[ Open a documentation issue  ]() [ Provide product feedback
](https://aka.ms/feedback/report?space=61)

##  Feedback

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the
feedback mechanism for content and replacing it with a new feedback system.
For more information see: [ https://aka.ms/ContentUserFeedback
](https://aka.ms/ContentUserFeedback) .

Submit and view feedback for

[ This product  ](https://aka.ms/feedback/report?space=61) This page

[ View all page feedback  ](https://github.com/dotnet/docs/issues)

* * *

##  Additional resources

[ California Consumer Privacy Act (CCPA) Opt-Out Icon  Your Privacy Choices
](https://aka.ms/yourcaliforniaprivacychoices)

Theme

  * Light 
  * Dark 
  * High contrast 

  *   * [ Previous Versions ](/en-us/previous-versions/)
  * [ Blog ](https://techcommunity.microsoft.com/t5/microsoft-learn-blog/bg-p/MicrosoftLearnBlog)
  * [ Contribute ](/en-us/contribute/)
  * [ Privacy ](https://go.microsoft.com/fwlink/?LinkId=521839)
  * [ Terms of Use ](/en-us/legal/termsofuse)
  * [ Trademarks ](https://www.microsoft.com/legal/intellectualproperty/Trademarks/)
  * © Microsoft 2024 

##  Additional resources