Visual-studio – Designer Added then removed by Visual Studio on load/unload

csprojdesignersubtypevisual studio

Anyone see this before? I have a large Visual Studio project that keeps adding [Subtype]Designer[/Subtype] to my .vcproj then removing it on the next open and close of the project. There is only one class defined in StoredImageControl.cs. Anyone know how to shut this off as it is really messing up my revision control.

This is before:

<EmbeddedResource Include="StoredImageControl.resx">
  <DependentUpon>StoredImageControl.cs</DependentUpon>
</EmbeddedResource>

This is after

<EmbeddedResource Include="StoredImageControl.resx">
  <DependentUpon>StoredImageControl.cs</DependentUpon>
  <SubType>Designer</SubType>
</EmbeddedResource>

Best Answer

This might be related to what files you have open in the saved solution state. I ran into this problem in VS2010 and found that if I close the solution while an .xml file was open in the editor, then on the subsequent re-open of the solution, the project containing that .xml file would get this <SubType>Designer</SubType> line added. If I close the solution without that file open, though, it does not try to add that line on the following re-open.