Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Commit

Permalink
revert, do not keep <import> elements that are included by default ta…
Browse files Browse the repository at this point in the history
…rget file
  • Loading branch information
KSchlobohm committed Apr 26, 2021
1 parent 9542b81 commit 3353dcc
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ static void UpdateBasedOnDiff(ImmutableArray<ItemsDiff> itemsDiff, ProjectItemGr
if (!itemTypeDiff.DefaultedItems.IsDefault)
{
var defaultedItems = itemTypeDiff.DefaultedItems.Select(i => i.EvaluatedInclude);
if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase)
// and this item is not an import element
&& !item.ElementName.Equals("import", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(item.Include))
if (defaultedItems.Contains(item.Include, StringComparer.OrdinalIgnoreCase))
{
itemGroup.RemoveChild(item);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,8 @@
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<ItemGroup>
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Data" />
<Import Include="System.Drawing" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows.Forms" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
<Compile Include="My Project\AssemblyInfo.vb" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
<NoWarn>41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314</NoWarn>
</PropertyGroup>
<ItemGroup>
<Import Include="System.Threading.Tasks" />
<Import Include="System.Linq" />
<Import Include="System.Xml.Linq" />
<Import Include="Microsoft.VisualBasic" />
<Import Include="System" />
<Import Include="System.Collections" />
<Import Include="System.Collections.Generic" />
<Import Include="System.Diagnostics" />
<Import Include="System.Windows" />
<Import Include="System.Windows.Controls" />
<Import Include="System.Windows.Data" />
Expand Down

0 comments on commit 3353dcc

Please sign in to comment.