Open
Description
I have following csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<CustomFileTypeItemGroup Include="**\*.customFileType"></CustomFileTypeItemGroup>
</ItemGroup>
</Project>
If I add via the Add new File
dialog a new File from Text File
template with the name TextFile1.customFileType
, Visual Studio changes the csproj to following:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<CustomFileTypeItemGroup Include="**\*.customFileType"></CustomFileTypeItemGroup>
</ItemGroup>
<ItemGroup>
<CustomFileTypeItemGroup Remove="TextFile1.customFileType" />
</ItemGroup>
roject>
It is removing the new file from the custom ItemGroup.
Is there any workaround to stop this? This behavior makes us problems in SpecFlow, as VS is removing items from our ItemGroups (they are defined in a props file in the NuGet package), which we need in a MSBuild Task.
This happens in Visual Studio 2017 15.9.5 and Visual Studio 2017 16.0.0 Preview 1.1.