dotnet / dotnet/project-system

new File gets removed from custom ItemGroup

Open
#4,483 9 comments 1 reaction 0 assignees View on GitHub
Discussion/Question Triage-Approved
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

I have following csproj:

```


netcoreapp2.2



```

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:

```


netcoreapp2.2






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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.