.NET Multiple Namespaces for single class

前端 未结 3 1634
一生所求
一生所求 2020-12-18 19:02

Is it possible to have a single class reside within two name-spaces and how can I do this?

To clarify: We have a class library (let say root namespace is classLib1),

3条回答
  •  眼角桃花
    2020-12-18 19:40

    Type Forwarding was introduced in .net 2.0, which means you can use the TypeForwardedToAttribute attribute to indicate that a type which was originally present in AssemblyX is now to be found in AssemblyY.

    I'm fairly sure this is only appropriate/applicable if you're separating out into multiple assemblies, but is worth knowing even if not.

提交回复
热议问题