-
Notifications
You must be signed in to change notification settings - Fork 412
Open
Labels
Discussion/QuestionA discussion or question about the project that will not be treated as a bug or feature request.A discussion or question about the project that will not be treated as a bug or feature request.Triage-ApprovedReviewed and prioritizedReviewed and prioritized
Milestone
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Discussion/QuestionA discussion or question about the project that will not be treated as a bug or feature request.A discussion or question about the project that will not be treated as a bug or feature request.Triage-ApprovedReviewed and prioritizedReviewed and prioritized