How to hide public methods from IntelliSense
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
In C#, a method that is truly public is part of your public API, so the first question is whether it should be public at all. If the method must remain callable but you want it to appear less prominently in editor completion, the usual tool is EditorBrowsable. That hides the member from IntelliSense in many IDE scenarios, but it does not change accessibility or security.
Use EditorBrowsable for IntelliSense Hiding
The standard attribute is EditorBrowsable with the Never state.
This tells supporting editors that LegacyMethod should not normally appear in IntelliSense. The method is still public and still callable in compiled code.
Understand What This Does Not Do
EditorBrowsable is a tooling hint, not an access control feature. Reflection can still see the member, existing source code can still call it, and consumers can still type its name manually.
That is why this attribute is best used for compatibility APIs, advanced members, or legacy methods you do not want to advertise in normal completion lists. It is not a substitute for good API design.
Prefer Real Visibility Changes When Possible
If a method should not be part of the public contract, the cleaner answer is often to make it internal, private, or move it behind an explicit interface implementation.
An explicit interface member does not show up as a normal instance method on Worker, which can be a better design than exposing a public method and then trying to hide it cosmetically.
Use Documentation to Explain Intent
If a public method exists only for framework integration, serialization, designer support, or backward compatibility, document that clearly. Hidden IntelliSense alone does not explain why the member exists.
That matters because advanced users may still discover the member through source, metadata, or manual typing. A short XML comment that says "for framework use only" is often more valuable than trying to make the API invisible.
Be Aware of IDE Differences
Most .NET tooling respects EditorBrowsable, but behavior can vary by editor, context, and whether the code is inside the same solution or assembly. You should treat the attribute as a strong hint, not as a guaranteed universal hiding mechanism.
This is another reason not to rely on it for correctness. If using the method would break callers, the method should not be public in the first place.
Versioning Is a Common Use Case
A practical use case is keeping an obsolete compatibility method callable for old code while steering new code toward a replacement.
This combines editor guidance with compiler guidance, which is usually much more effective than hiding alone.
Common Pitfalls
- Trying to hide a method from IntelliSense when the real issue is that the method should not be public.
- Assuming
EditorBrowsableprevents access instead of only influencing tooling. - Relying on hidden completion as a security or correctness boundary.
- Forgetting to document why a hidden public method still exists.
- Ignoring alternatives such as
internalor explicit interface implementation.
Summary
- Use
EditorBrowsable(EditorBrowsableState.Never)to hide a public member from IntelliSense in many cases. - The method remains public and callable.
- Prefer real visibility changes when the member is not meant to be part of the public API.
- Combine hiding with documentation or
Obsoletewhen you are guiding users away from legacy members. - Treat IntelliSense hiding as a usability hint, not as enforcement.
Related reading
- How to identify if the DLL is Debug or Release build in .NET
- How to implement cancellation in Request Reply Pattern in .NET?
- How to implement Oplock opportunistic locking in .NET?
- How to include more outcomes on Infer.NET's BPM?
- How to increase the max upload file size in ASP.NET?
- How to initialize a ListT to a given size as opposed to capacity?
- How to inject Javascript in WebBrowser control?
- How to install a windows service programmatically in C?

OOD Fundamentals
Master object-oriented design from first principles, SOLID, design patterns, and classic interview problems with hands-on coding.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.