views:

1055

answers:

2

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:

ASPXCodeBehind

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?

+2  A: 

Splitting the content of your file into multiple files - one file per class may help.

https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283434

Eren Aygunes
Thanks, but no, that doesn't help - I only have the one class (an ASPX page codebehind class) in each affected file.
Evgeny
+1  A: 

I have the same problem except the the subtype element does not added again. Only happens to me as well and not to any of the other developers on the team.

I have a discussion about it here, hopefully I will get some answers.

Jacques