Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS 2008 keeps removing and re-adding <SubType>ASPXCodeBehind</SubType>

I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file:

<SubType>ASPXCodeBehind</SubType> 

So something like this:

<Compile Include="Default.aspx.cs">   <DependentUpon>Default.aspx</DependentUpon>   <SubType>ASPXCodeBehind</SubType> </Compile> 

will become

<Compile Include="Default.aspx.cs">   <DependentUpon>Default.aspx</DependentUpon> </Compile> 

BUT the next time I work on this project it will add those lines back! It keeps going back and forth like this, resulting in a lot of meaningless "changes" in our source control system. This never used to happen with VS 2005 and it doesn't seem to be happening for other developers who work on the same project file, only for me.

Does anyone know why this is happening and how I can stop it from doing this?

like image 248
EMP Avatar asked Nov 05 '08 00:11

EMP


1 Answers

For me, the difference depends on whether or not the web project is open in Visual Studio.

I find if I commit the project file to version control with the project open in Visual Studio the SubType elements are present. Closing the solution/project then removes the SubType elements from the project file. Now I always ensure my commits are performed with the project closed in VS to avoid unnecessary changes to the project file.

like image 57
Tom Avatar answered Sep 23 '22 17:09

Tom