Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop Visual Studio 2019 from automatically adding files in project folder

I have a .NET Core 3 project in Visual Studio 2019. When I copy and paste a file, through Windows Explorer, into the project folder, Visual Studio automatically includes the file into my project, which I do not want to happen. Is there a setting to disable this feature?

like image 939
Scott Forbes Avatar asked Aug 03 '26 16:08

Scott Forbes


1 Answers

Starting from VS 2017 project format in .NET has changed. You need to add <PropertyGroup> tag at the top of your .csproj file:

<PropertyGroup> 
    <EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>

Here is the complete answer to your question: In Visual Studio, why are all files automatically part of my C# project?

like image 173
Likhtarovich Avatar answered Aug 08 '26 11:08

Likhtarovich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!