Spargine Mouse PadI am happy to announce my open-source assemblies and NuGet packages for .NET 6 & 7 called Spargine! 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.


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. CachedEnumerable
  3. Common collection types
    1. Collection
    2. FastSortedList
    3. ObservableHashSetSingleton
    4. ObservableList
    5. ChannelQueue
    6. ConcurrentHashSet
    7. DistinctBlockingCollection
    8. DistinctConcurrentBag
  4. Computer information
  5. Custom Exceptions
  6. Encryption
  7. Exception thrower
  8. Logging
  9. Password Hasher
  10. PerformanceStopWatch
  11. Serialization: XML and JSON!
  12. Validator: Validates method parameters and other validations.
  13. 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. Assembly information
  2. Collections: Array, Collection, Dictionary, Enumerable, HashSet, ImmutableArray, List, ObservableCollection, SortedDictionary, SortedSet
  3. DataContext
  4. DateTime
  5. DirectoryInfo
  6. Enum
  7. Exceptions
  8. HttpClient, HttpConttext, HttpRequest, HttpResponse header
  9. Logging
  10. LINQ
  11. Numeric
  12. Object
  13. Process
  14. Stream
  15. String
  16. StringBuilder
  17. Task
  18. Thread
  19. Type
  20. 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. Directly and File helpers
  2. HttpClient helper
  3. InMemoryCache
  4. Services: Start and stop services along with getting a list of services.
  5. Sockets helper
  6. Registry extensions.


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, runing 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 7 is IntelliTests since I could have had this work done a long time ago. If you want IntelliTests back in .NET 7, please vote by going here:

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!