<Subtype>Designer</Subtype> Added then removed by Visual Studio on load/unload

Visual StudioDesignerCsprojSubtype

Visual Studio Problem Overview


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>

Visual Studio Solutions


Solution 1 - Visual Studio

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.

Solution 2 - Visual Studio

This has been an issue in at least 3 editions of Visual Studio, 2008, 2010 and now 2012. It is logged as a bug in Microsoft Connect but the MS answer is "We have recorded your request but are not planning on fixing this at this time." Suggest you up vote the bug report as it is still active and might get a better response from MS with enough up votes.

Solution 3 - Visual Studio

Do you try to put the SubType as an attribute of the EmbeddedResource object?

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

I saw a question like yours in the following link and he solved his problem with this:

[http://community.sharpdevelop.net/forums/t/9977.aspx][1]

[1]: http://community.sharpdevelop.net/forums/t/9977.aspx "Related question"

Solution 4 - Visual Studio

I am encountering the same problem in my ASP.NET web application's .csproj file:

<ItemGroup>
  <Content Include="site.master" />
  <Content Include="Web.config">
    <SubType>Designer</SubType>
  </Content>
</ItemGroup>

Versus:

<ItemGroup>
  <Content Include="site.master" />
  <Content Include="Web.config" />
</ItemGroup>

My annoyance with this issue is due to revision control changes as well. The issue seems to be present in VS 2005/2008/2010. Have found the following question on Microsoft forums, but the answer is not clear.

I hope that a VS setting causes it, in which case, I will like you know when I find out what that setting is.

Solution 5 - Visual Studio

I found that <SubType>Designer</SubType> changes the behaviour for Web.config.

We use WebDeploy to publish web service files.

If SubType is set for Web.config - it publishes this file correctly under the main directory where all content files go and .svc.

If SubType is not set - it does above but also copies Web.config under bin\ subdirectory - which is very strange! In MsBuild log this happens during CollectFilesFrom_SourceItemsToCopyToOutputDirectory target.

Solution 6 - Visual Studio

For me also this causes issues with version control when added new files to the project.

As a work around I did: undo pending changes to the project file and then manually added new files by right click -> add existing files to the project.

While doing this the tag < SubType >Designer< /SubType > doesn't come.

Hope this will help someone. Hence posting this.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJeff LundstromView Question on Stackoverflow
Solution 1 - Visual StudioNathan ReedView Answer on Stackoverflow
Solution 2 - Visual StudioJohnCView Answer on Stackoverflow
Solution 3 - Visual StudioMauro GagnaView Answer on Stackoverflow
Solution 4 - Visual StudioJohnBView Answer on Stackoverflow
Solution 5 - Visual StudioIvanView Answer on Stackoverflow
Solution 6 - Visual StudioNidhinSPradeepView Answer on Stackoverflow