为什么Visual Studio 2010会随机更改web.configs的项目文件?

Chr*_*sic 6 random behavior projects-and-solutions visual-studio-2010

为什么Visual Studio 2010会随机更改web.configs的项目文件?

使用Mercurial我经常在提交窗口中看到差异

-    <Content Include="Admin\Web.config" />

+    <Content Include="Admin\Web.config">
+      <SubType>Designer</SubType>
+    </Content>
Run Code Online (Sandbox Code Playgroud)

它将不断翻转子类型以存在或不存在.

jev*_*lio 1

我有时也遇到过同样的问题,某些项目会出现这种情况,但其他项目则不会。真令人气愤。

我还没有找出根本原因,但我通过手动插入 SubType 作为属性解决了这个问题。

<Content Include="Admin\Web.config" SubType="Designer" />
Run Code Online (Sandbox Code Playgroud)

这是一个 hack,但解决了这个问题,至少在 VS2008 中是这样。