Cleaning a C# Form-based project using a .bat

A .bat script to clean garbage files from your C# Form project

Cleaning a C# Form-based project using a .bat

After creating a Windows Form App project using Visual Studio 2019, and try to push the code to a git repository, I realized there are still garbage files. My initial thought was executing the Clean Project option, however, it does not clean all files that I consider as garbage 😩 (at least on the default setting).

My following thought was to change options into the  Setting of Visual Studio, but after a while, I finish adjusting the size  of the font on the editor and trying different fonts...procrastination 🤡

To replicate this, I started with a Windows Forms App (.NET Framework) option in my Visual Studio:

Initial screen in Visual Studio 2019 where appear the Windows Forms App option

Then, I started coding 🤓 and when before to upload the code to the git repository I clean the code with the following .bat:

You can edit the .bat as you want, it works fine in Windows 10.

Honestly, this is not mandatory at all, the habitual way is adding the file extensions into the .gitignore file and continue with your life, but I can't #sorryNotSorry 👻

I hope that could help more developers who want clean projects 😃

From a geek to geeks


Share Tweet Send
0 Comments
Loading...

Related Articles