表格分为3个项目

时间:2016-07-26 17:57:45

标签: vb.net visual-studio-2015

enter image description here

如您所见,一个表单分为3个项目:.Designer.vb,.resx和.vb。

.Designer.vb和.resx应该是.vb文件的子代。

项目中的其他表单没问题,它们具有有效的层次结构。

有谁知道为什么会发生这种情况以及如何避免它?

1 个答案:

答案 0 :(得分:1)

在Visual Studio 2010的正常.vbproj文件中,表单的文件声明如下:

<Compile Include="Form1.vb">
  <SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.vb">
  <DependentUpon>Form1.vb</DependentUpon>
  <SubType>Form</SubType>
</Compile>

这位于<ItemGroup>标记内,然后.resx - 文件位于下一个<ItemGroup>标记下(但是将它们放在同一个标​​签中应该不会有问题)我知道):

<EmbeddedResource Include="Form1.resx">
  <DependentUpon>Form1.vb</DependentUpon>
</EmbeddedResource>

所以我们在这里看到它是<DependentUpon>标签,表示文件之间的关系,即每个子文件都包含它。

除了排除和重新导入所有文件之外,我没有自动解决这个问题,我想。但由于这显然不适合您,您只需手动编辑.vbproj - 文件,并按照此结构处理每个损坏的表单。