EditorBrowsable - EditorBrowsableState.Never shows up in Intellisense

I had a property in a WebControl marked as EditorBrowsableState.Never but it was still showing up in Intellisense. After googling for a long time, I found this post with a response by Linda Liu.

Speaking for C#, the EditorBrowsableAttribute attribute only influences C#  IntelliSense filtering behavior if the decorated item is imported from metadata.

That's to say, you should compile the EditorBrowsableAttribute-decorated  project (e.g project 1) into an assembly (.dll or .exe) and then in another project (e.g project 2) add a reference to that assembly. In project 2, you should see the attribute at work.

C# IntelliSense filtering behavior is not influenced if you are coding in project 1. What's more, if you add a project-to-project reference to project 1 in project 2, C# IntelliSense filtering behavior is not influenced when you are coding in project 2 either.

The IDE is intended to filter items from consumers of your assembly and not to filter items from yourself as you code the assembly.

Since I had a project to project reference, intellisense ignored this attribute - aargh :-(

5 Comments

Comments have been disabled for this content.