Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

FileCodeModel does not include attributes on enum values in VB

$
0
0

In my Visual Studio Package I use a recursive scan of the CodeElements in the FileCodeModel. In particular, I want to detect all attributes in a code file.

I have found that attributes associated with an enum value are represented by CodeElements if they are defined in C#, but not if they are defined in VB.

Example in C#:

    [Description("Enumeration test")]
    enum testEnum
    {
      [Description("Number one")]
      one,
      [Description("Number two")]
      two
    }

Example in VB:

<Description("Enumeration test")>
  Enum testEnum<Description("Number one")>
    One<Description("Number two")>
    Two
  End Enum

In both cases the Description attribute associated with the enum itself is represented in the FileCodeModel.

The Description attributes associated with the enum values are only included in the FileCodeModel for the C# version.

Is this a well known effect?
Is it by design?
Should I report it as a bug?

I could post some code if it helps.
(But I would want to make a clean example rather than just copy the code from my project.)

Phil



Viewing all articles
Browse latest Browse all 4410

Trending Articles