问题描述
我有一个VS 2008的C#Web项目,每当我做出一些改变的文件中它(甚至没有对项目文件本身)VS将从的csproj文件中删除一些像这样的行:
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>
将成为
<Compile Include="Default.aspx.cs">
<DependentUpon>Default.aspx</DependentUpon>
</Compile>
BUT 下一次我在这个项目上工作,它会添加这些行回来了!它不断来回这样,造成了很多在我们的源代码控制系统毫无意义的转变。这从来没有使用过,与2005年VS发生,它似乎并不能对发生的事情谁在同一个项目文件的工作,只为我其他的开发者。
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?
推荐答案
对于我来说,差别取决于Web项目是否在Visual Studio中打开。
For me, the difference depends on whether or not the web project is open in Visual Studio.
我发现,如果我提交的项目文件版本控制与项目打开Visual Studio中的子类型元素是present。关闭该解决方案/项目然后删除该项目文件中的子类型的元素。现在,我总是确保我的提交与VS中关闭项目,避免项目文件中不必要的变化进行的。
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.
这篇关于VS 2008保持删除并重新添加&LT;亚型GT; ASPX codeBehind&LT; /亚型GT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!