Spargine Dev Tool: For Microsoft .NET Developers

In 2016, I launched my first free application for Microsoft .NET developers, designed to tackle common challenges developers frequently encounter. Since its initial release, I have continuously expanded its features and functionality to provide even greater value.

One of the app’s core features from the start was the ability to clean up temporary and cached files that Visual Studio, SQL Server, and other applications leave behind. These residual files can lead to issues like failed builds, debugging errors, and unnecessary clutter. By automating this cleanup process, the tool helps developers maintain a smoother workflow.

Another essential feature I introduced allows users to quickly scan their computers for source code and create backups. This functionality was born out of my own frustrations with source control systems occasionally losing code. By providing an additional layer of security, this feature has proven invaluable to many developers.

Now, with the release of the third major version, I have transformed the application into a Microsoft .NET global tool. This significant upgrade enhances performance and makes it seamlessly accessible from the command line. Developers can now easily integrate it into build scripts or use it in pre/post-build events within Visual Studio, streamlining their development process.

I remain committed to improving and evolving this tool to better serve the developer community. If you have suggestions or feedback on how to make it even more useful, I would love to hear from you!

Demo: See the Spargine Dev Tool in Action!

Watch how the Spargine Dev Tool effortlessly cleans up development clutter, backs up your source code, and resolves pesky build issues in just seconds!

Clean Folders: Optimize Your Development Workflow

If you are facing unexplained build or testing issues in your code, the clean function can be a game-changer. This powerful feature efficiently removes temporary and cached files from your computer, often resolving issues that interfere with builds, debugging, or testing.

Beyond fixing problems, the clean function helps reclaim valuable disk space. By clearing out unnecessary files, you can free up gigabytes of storage, ensuring your system runs smoothly. You also have complete control—simply add any folder to the cleanup list to include it in the process.

Performance You Can Trust

I have optimized the clean function to be both fast and effective. On my machine, it can delete over 3K files per second, providing an incredibly swift and reliable cleanup.

If you have ever encountered frustrating, unexplained errors in your Visual Studio projects, give the clean command a try—it might be the key to resolving your issue and optimizing your development experience.

Clean Command Reference

CommandDescription
cleanCleans the configured folders (see list below).
clean –turbobackupCleans folders, followed by a turbo backup of changed files.
clean –nugetCleans folders, followed by clearing the NuGet package cache.
clean –af|–addfolder <folder name>Enables a folder to be cleaned.
clean –rf|–removefolder <folder name>Disables a folder from being cleaned.

Usage Examples

  • spargine clean
    Runs the standard cleanup process.
  • spargine clean –af c:\temp
    Adds C:\temp to the cleanup list.
  • spargine clean –rf c:\temp
    Removes C:\temp from the cleanup list.
  • spargine clean -turbobackup
    Runs clean and then performs a turbo backup of modified files.

Why is this feature essential for Visual Studio developers?

Many developers experience unexpected build errors, failed tests, and debugging issues due to residual cached files. The Clean feature helps resolve these issues instantly.

Real-world Examples:

  • 206 Unit Test Failures Resolved Instantly – After pulling the latest files from source control, I suddenly encountered 206 unit test failures. Running the Clean function and re-running the tests resulted in 0 failures!
  • Build Failure Fixed After NuGet Updates – Updating all NuGet packages in a solution caused the build to fail completely. After running Clean, the solution built successfully without further issues!

If you are dealing with strange, unexplained build errors, give the clean feature a try—it might be exactly what you need!

Code Backup: Safeguard Your Source Code

The backup command is designed to simplify and streamline the process of protecting your Visual Studio project files. This essential feature is especially useful when working with source control repositories, ensuring you always have a reliable backup in case of unexpected data loss or corruption.

How It Works

  • When you run the backup command for the first time, the tool scans all drives on your computer for source code files.
  • Every 7 days (default setting), it performs another scan to detect and back up any new or modified files.
  • When the tool discovers a new source code folder, you will be prompted to include it in the backup process.

Given the potential volume of source code on your system, the initial backup may take some time. To optimize this process, I have implemented a turbo backup mode, which only backs up files marked with the archive flag, significantly reducing backup time.

Where Are Backups Stored?

  • By default, backups are saved to your OneDrive folder, ensuring they are securely stored in the cloud.
  • If OneDrive is not installed, the backup location defaults to:
    C:\Users\<user>\AppData\Local\Spargine\Backup
  • To prevent excessive storage usage, the tool automatically deletes backup folders older than 7 days, keeping your backups efficient and organized.
  • To change the backup location, use the command: backup –bf|–backupfolder

To prevent excessive storage usage, the tool automatically deletes backup folders older than 7 days, keeping your backups efficient and organized.

Backup Command Reference

CommandDescription
backupBack up the source code on the computer.
backup –turboEnables turbo mode for faster backups (backs up only files with the archive flag).
backup –rescanRescans the computer for source control. The default behavior is to rescan the computer every 7 days.
backup –cleanprojectsEnables the cleaning of bin and obj folders during a backup.
backup –af|–addfolder <folder name>Adds a folder to be backed up.
backup –rf|–removefolder <folder name>Removes a folder to be backed up.
backup –bf|–backupfolder <folder name>Sets the location of the backup folder.
backup –ecp|–enablecleanprojectsEnables the cleaning of obj and bin folders when used in conjunction with the ‘add folder’ command.

Usage Examples

  • spargine backup
    Runs a full backup of source code files.
  • spargine backup –turbo
    Runs a faster backup, backing up only changed files.
  • spargine backup –turbo –rescan
    Rescans the computer for source code and then runs a turbo backup.
  • spargine backup—cleanprojects
    Runs a backup and afterwards cleans the obj and bin folders for the enabled folders.
  • spargine backup –ecp –af c:\temp
    Adds C:\temp to the backup list and enables the cleaning of obj and bin folders.
  • spargine backup –rf c:\temp
    Removes C:\temp from the backup list.
  • spargine backup –bf c:\backup
    Sets C:\backup as the backup destination.

Why Use the Backup Command?

If you’ve ever lost code due to a failed merge, accidental deletion, or source control mishap, having an automatic backup can be a lifesaver.

With turbo backup, you get quick and efficient backups without unnecessary redundancy. With cloud storage integration, your backups are always accessible and secure.

Start using backup today and ensure your source code is always protected!

Installation Guide

Installing the dotNetTips.Spargine.Dev.Tool is quick and easy. Follow the steps below to install, update, or remove the tool using the .NET CLI.

Install the Tool

To install or update the tool globally on your system, open a command window and run:

dotnet tool update --global dotNetTips.Spargine.Dev.Tool

Uninstall the Tool

If you need to remove the tool from your system, use the following command:

dotnet tool uninstall --global dotNetTips.Spargine.Dev.Tool

More Information

For the latest updates, release notes, and detailed package information, visit:
NuGet Package: dotNetTips.Spargine.Dev.Tool

Future Work: Upcoming Features

I am actively working on expanding and improving dotNetTips.Spargine.Dev.Tool to make it even more powerful and efficient. Below are some of the key features that will be added soon.

Code Backup Enhancements

  1. Customizable File Type Exclusions – Add support for excluding specific file types from backups. Currently, the default exclusions include: aps, bak, cache, cachefile, csdef, dbmdl, dll, docstates, dotCover, gpState, JustCode, ncb, nupkg, opendb, opensdf, optpfx, plg, props, psess, publishproj, publishsettings, pubxml, sap, schemaview, sdf, snk, suo, targets, temp, tmp, user, userosscache, userprefs, vsp, vssscc, vspscc, vspx, zip, pdb, compiled, rsp
  2. .gitignore Integration – Automatically exclude file types listed in the project’s .gitignore file.

I am always open to feedback and suggestions! If you have ideas for additional features or improvements, feel free to reach out.

Folders That Will Be Cleaned

The Clean function automatically removes outdated and unnecessary files from various system and development-related folders. This helps prevent build and debugging issues while reclaiming valuable disk space.

Default Folders Included in Cleanup

The following folders are automatically cleaned:

Development & Build Cleanup

  • CodeRush Logs
  • IIS Express Logs – C:\Users\<user>\OneDrive\Documents\IISExpress\Logs
  • Local Assemblies – C:\Users\<user>\AppData\Local\assembly
  • NuGet Cache – C:\Users\<user>\AppData\Local\NuGet\v3-cache
  • SQL Server Management Backup Folders – C:\Users\<user>\OneDrive\Documents\SQL Server Management Studio\Backup Files
  • SQL Server Temporary Folders
  • Submain Cache
  • Temporary ASP.NET Folders – C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
  • User Local Temp Folder – C:\Users\<user>\AppData\Local\Temp\

Microsoft & Visual Studio Cleanup

  • Cryptnet URL Cache – C:\Users\<user>\AppData\LocalLow\Microsoft\CryptnetUrlCache
  • Isolated Storage – C:\Users\<user>\AppData\Local\IsolatedStorage
  • Microsoft Caches – C:\Users\<user>\AppData\Local\Microsoft\Caches
  • Visual Studio Application Insights – C:\Users\<user>\AppData\Local\Microsoft\VSApplicationInsights
  • Visual Studio Backup Folders
  • Visual Studio Component Model Cache – C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\16.0_8319667a\ComponentModelCache
  • Visual Studio Project Assemblies – C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\ProjectAssemblies
  • Visual Studio Services – C:\Users\<user>\AppData\Local\Microsoft\Visual Studio Services
  • Visual Studio / GitHub Blob Cache – C:\Users\<user>\AppData\Local\GitHubVisualStudio\BlobCache
  • Visual Studio / GitHub GraphQL Cache – C:\Users\<user>\AppData\Local\GitHubVisualStudio\GraphQLCache
  • Website Cache – C:\Users\<user>\AppData\Local\Microsoft\WebsiteCache

Request Additional Cleanup Folders

If you have a folder you think should be permanently added to this list, feel free to email me, and I will consider adding it in the next version!

Summary

I hope the Spargine Dev Tool proves as valuable to you and your team as it has been for me in my daily workflow!

Whether you are backing up source code, cleaning development folders, or resolving build issues, this tool is designed to enhance productivity and streamline your development process.

Got feature ideas?
Encountered any issues?

Feel free to reach out—I would love to hear your feedback! dotNetDave@live.com

Thank you for your support, and happy coding!

Pick up any books by David McCarter by going to Amazon.com: http://bit.ly/RockYourCodeBooks

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

If you liked this article, please buy David a cup of Coffee by going here: https://www.buymeacoffee.com/dotnetdave

© The information in this article is copywritten and cannot be preproduced in any way without express permission from David McCarter.


Discover more from dotNetTips.com

Subscribe to get the latest posts sent to your email.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.