Spargine Mouse PadI am happy to announce my new open-source assemblies and NuGet packages for .NET 5 called Spargine! I’ve been working hard for close to 6 months to move code from my .NET Framework and .NET Core assemblies into these new projects. While I still have a lot more code to move, the core code and assemblies are done along with a lot more unit tests and benchmark tests! Just moving to .NET 5 has increased the performance of most of the code too!



These assemblies contain the common code I have been writing ever since .NET 2! Not only do I use these assemblies in all my projects, but it is currently in production at the current company that I work for.


Below is the list of the assemblies that are being released today (more to come) and descriptions.

Spargine Assembly Layout


This assembly contains code that is used by all the other assemblies. Just some of the of what is contained are:

  1. Application information
  2. Common collection types
  3. Computer information
  4. Custom Exceptions
  5. Exception thrower
  6. Logging
  7. Serialization: XML and JSON!
  8. Validator (Formerly Encapsulation): Validates method parameters and other validations.
  9. Web: ServiceProxy and Web helper methods


This assembly contains all the extension methods used by the assemblies. Over 39 classes so far! Here are some of the highlights:

  1. Collections: Array, Collection, Dictionary, Enumerable, HashSet, ImmutableArray, List, ObservableCollection, SortedDictionary, SortedSet
  2. DataContext
  3. DataReader
  4. DirectoryInfo
  5. Enum
  6. Exceptions
  7. LINQ
  8. Numeric
  9. Object
  10. String
  11. StringBuilder
  12. Task
  13. Thread
  14. Type
  15. WebClient


This assembly contains more higher-level code and/ or specific to Windows. I will be adding a lot more to this assembly, but this is what it contains so far:

  1. InMemoryCache
  2. Collections: ConcurrentHashSet, DistinceConcurrentBag, FastSortedList, ObservableList, CollectionRandomizer and DistinctBlockingCollection
  3. HttpClientHelper
  4. SocketsHelper


This assembly was converted from dotNetTips.Utility.Core.Tester for use in unit tests and benchmarking tests. The main class in this assembly is called RandomData that helps generate random data. Along with that, new types using the new record class types in .NET 5 along with methods to generate the data.

I have written about this assembly in this article:

I use this assembly in ALL my unit tests and benchmark tests!


Since I now have many benchmarking test projects using BenchMarkDotnet, I decided to move the common code for these projects into this new assembly. The main classes are:

  1. Benchmark: Base class for all benchmark tests. This contains common info and sets a default configuration using attributes. For example, I configure all the export formats here and ordering.
  2. CounterBenchmark: This class features a counter used in most of the benchmark tests that allows the tests to run with multiple collection counts used to generate data. This class also pre-creates many of the collections used in testing.
  3. CollectionBenchmark: Class used for all the benchmark tests for collection types.

Now when I need to create a new benchmarking project and classes, this assembly makes it very easy and consistent!

Articles (Documentation)

  • FIFTH RELEASE: New code for hashing passwords with PBKDf2 and SHA256, string compression using GZip or Brotli, validating string length, validating string data types, methods for inspecting types, new extensions methods for numbers, and more!
  • FORTH RELEASE: New methods that encrypt and decrypt strings, running async tasks synchronously, fire and forget async methods, safely searching a directory, how to create a thread-safe queue, PickRandom<T>() for ReadOnlySpan<T> and more.
  • THIRD RELEASE: New methods that retrieve application information, retrieve common environment variables, retrieve reference assemblies, and more.
  • SECOND RELEASE: Changes for this release includes removing carriage return and line feeds from strings, retrieving property values, IsEnumerable() that determines if a type is a collection, safely loading a list of files, validating for null, validating parameters for null, validating an object, base type for record types, creating a blocking collection, moving files with options and more.
  • FIRST RELEASE: Changes include Logging application information, logging computer information, retrieving property names & values, converting a Dictionary to a delimited string, converting object properties to a Dictionary, converting obje3ct property values to a string, returning a formatted string from a DataTime, returning a formatted string from a number, creating an enumeration without using Enum.

Unit Testing

I wanted to release these assemblies in January, then February but had to wait until now due to all the unit tests I have been writing or re-working. I wanted to have 75% coverage or better but am currently at 53%. I will continue to strive for 100% coverage for the new code while I fill in the rest.

If you would like to help with writing unit tests, please email me at Not only will you get your name listed as a contributor, which could help with job interviews, then I will send you swag! If you live in the United States, I will send you one of my books too (as supplies last).

One thing I have really, really wished worked for .NET 5 is IntelliTests since I could have had this work done a long time ago. If you want IntelliTests back in .NET 5, please vote by going here:

Breaking Changes

Since I moved all the previous code to .NET 5, I decided to move a lot of the code into assemblies that make more sense and discoverable (except for extensions) along with changing method names and even parameters. Along with this, I have taken the time to write better documentation including sample code!

Due to this, if you used one of my older assemblies, you might run into breaking changes. I have tried to keep these to a minimum and in all the code I have had to change so far, most can be fixed with a simple search and replace.

If you run into major issues or cannot find something, please email me at

Looking for Contributors!

Do you have common code that you have written that you would like to contribute to this project? I am always looking for this type of code, so please download the source, make your improvements, and then submit a pull request!

If I accept it (make sure you follow the coding standards in my book), I will send you swag and if you live in the U.S., one of my books (while supplies last). I have a lot of swag sitting in my home due to not speaking in person for over a year!

To contribute, go to


I hope you will check out these assemblies. Stay tuned to this site for upcoming quarterly releases! If you have any comments or suggestions, please comment below. I am always looking for new ideas for these open-source projects!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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