Author Topic: SE corrupts .vbproj when adding files  (Read 4439 times)

Steve Black

  • Community Member
  • Posts: 57
  • Hero Points: 4
SE corrupts .vbproj when adding files
« on: March 04, 2008, 08:52:40 PM »
Having my VB 2005 project open in SE, Used Project->Properties->Add Files... 

I selected the four files to add, clicked ok, ok and the Projects toolbar was updated with only one of the files.  I repeated, thinking maybe a stray click betrayed me, but in fact it was only adding one of the selected files each time through.

A short time later I opened the project in Visual Studio and was informed that it could not be opened because the <None> element below <Project> could not be read.  I then opened the .vbproj file in SE and this is what I found.

What SE produced:
Code: [Select]
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  .
  .
  .
  <ItemGroup>
    .
    .
    .
    <None Include="POMaster_FindOne.sql" />
    <None Include="POMaster_Update.sql" />
    <None Include="POMaster_GetOne.sql" />
    <None Include="POMaster_GetIssuances.sql" />
  </ItemGroup>
  <None Include="POMaster_GetIssuances.sql" />
  <None Include="POMaster_GetOne.sql" />
  <None Include="POMaster_GetIssuances.sql" />
  <None Include="POMaster_Update.sql" />
  <None Include="POMaster_GetOne.sql" />
  <None Include="POMaster_GetIssuances.sql" />
  .
  .
  .
</Project>

What SE should have produced:
Code: [Select]
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  .
  .
  .
  <ItemGroup>
    .
    .
    .
    <None Include="POMaster_FindOne.sql" />
    <None Include="POMaster_Update.sql" />
    <None Include="POMaster_GetOne.sql" />
    <None Include="POMaster_GetIssuances.sql" />
  </ItemGroup>
  .
  .
  .
</Project>

Notice that each file appears once within the <ItemGroup> as it should, but that outside the <ItemGroup>, where <None> is not valid, there is 0 or more extra occurrences of each file.  As it turns out, the extra occurrences correspond to my extra attempts with one less file selected each time.

Evidently, each Add Files attempt put one of the files in the <ItemGroup> and all remaining files outside the <ItemGroup>.