Simon Achmüller
Simon Achmüller

Reputation: 1176

How to prevent Visual Studio 2017 from adding log files into solution?

I have a C# .Net Core project and when I run this project the executable creates log file in it working directory which is same as project directory (where .csproj and other files are placed)it looks like so

It is a rolling file, so every day it creates a new file with Date in the file name.

Problem is: Visual Studio adds this files into solution automatically:enter image description here

How can I prevent this behavior? (This files are already in .tfignore file for TFVC but of course it has no impact on VS behavior).

UPDATE: I can exclude it from project manually but I don't like to do it every day.

Upvotes: 0

Views: 604

Answers (1)

Simon Achmüller
Simon Achmüller

Reputation: 1176

I found solution:

  1. Open your .csproj xml file
  2. Add new section:

<ItemGroup> <None Remove="log*.txt" /> </ItemGroup>

  1. Enjoy you work!

Upvotes: 1

Related Questions