Disable designer in Visual Studio?

I. J. Kennedy picture I. J. Kennedy · Feb 19, 2009 · Viewed 15.6k times · Source

I'm using Visual C# Express to write Windows Form applications, and call me old school, but I don't like the designer. It is a nuisance and pollutes my project with lots of unwanted files, as well as unwanted monkey-generated source code.

Please tell me there's a way to turn it off completely.

Answer

Andrew picture Andrew · Mar 2, 2009

Add a [System.ComponentModel.DesignerCategory("")] attribute before a UI class to avoid designer activation on double-click.

Note that including System.ComponentModel at the top of the file and then just adding the attribute as [DesignerCategory("")] will not work (at least not in Visual Studio 2010/2013). You must use the full, namespace-qualified attribute type name.