FIX: Classes converted from VS2008 to VS2010 appear as Components

by Bill Sempf 26. August 2010 20:00


I don’t remember how this happens (I was told at one point) but sometimes, when you convert a project from VS2008 to VS2010 some classes will appear to be components.  This is annoying, because when you double click to open them, they try to load in the designer, which doesn’t work at all.

To fix this:

  1. Open your Visual Studio Project file in Notepad.  It should be .csproj or .vbproj.  You’ll have to close Visual Studio first.
  2. Locate the reference to the file in question.  It will look like this:
  3. <Compile Include="Connection.cs">
  4. Delete the Component subtype, so the line looks like this:
  5. <Compile Include="Connection.cs" />
  6. Rinse and repeat for each file affected.


Biz | C# | VB

Comments (1) -

mgroves United States
8/27/2010 8:18:27 AM #

That's weird, I haven't experienced that yet.  Any idea at all why it happens?  Some sort of attribute snafu or something?

Comments are closed

Husband. Father. Pentester. Secure software composer. Brewer. Lockpicker. Ninja. Insurrectionist. Lumberjack. All words that have been used to describe me recently. I help people write more secure software.

Find me on Mastodon

profile for Bill Sempf on Stack Exchange, a network of free, community-driven Q&A sites