Com.MarcusTS.SharedUtils 2.0.5

.NET Standard 2.0
Install-Package Com.MarcusTS.SharedUtils -Version 2.0.5
dotnet add package Com.MarcusTS.SharedUtils --version 2.0.5
<PackageReference Include="Com.MarcusTS.SharedUtils" Version="2.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Com.MarcusTS.SharedUtils --version 2.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Com.MarcusTS.SharedUtils, 2.0.5"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Com.MarcusTS.SharedUtils as a Cake Addin
#addin nuget:?package=Com.MarcusTS.SharedUtils&version=2.0.5

// Install Com.MarcusTS.SharedUtils as a Cake Tool
#tool nuget:?package=Com.MarcusTS.SharedUtils&version=2.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.


SHARED UTILS: Making C# Quick, Easy and Safe

Programs Should Not Be Redundant In Any Way

SOLID and DRY guidance declare that we should keep our C# code simple, narrow, and non-redundant. For instance, simple code like this:

var areSame = 
   string.Compare(mainStr, otherStr, CurrentCulture.CurrentCultureIgnoreCase) == 0;

... is both ungainly and unnecessary. DRY does not refer to copying code like this, though it is certainly illegal:

var areSameCheckedAgainRedundantly = 
   string.Compare(mainStr, otherStr, CurrentCulture.CurrentCultureIgnoreCase) == 0;

DRY means: no redundancy whatsoever, regardless of where it lurks. In this example, a parameter is redundant, and the check for 0 is both static (not a variable but also not even a constant!) and redundant. The fix is easy -- just use our SharedUtils extensions to code this quickly and safely:

using Com.MarcusTS.SharedUtils;

if (mainStr.isSameAs(otherStr))

If you are looking for "not same as", then use this:

using Com.MarcusTS.SharedUtils;

if (mainStr.isDifferentThan(otherStr))

SharedUtils provides similar comparison extensions for many C# types, including DateTime, numbers, and even IEnumerables!

SharedUtils also offers:

  • A BetterObservableCollection that manages events more safely than in the C# version.
  • A FlexibleStack that allows manipulation of a common stack.
  • Reflection helpers
  • Thread helpers,including a thread-safe Boolean
  • Task helpers
  • Numeric rounding

SharedUtils Is Open Source; Enjoy Our Other Offerings

Shared Utils (MAUI Ready!)



The Smart DI Container (MAUI Ready!)



Responsive Tasks (MAUI Ready!)



PlatformIndependentShared (MAUI Ready!)






The Modern App Demo



Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on Com.MarcusTS.SharedUtils:

Package Downloads

A container that creates and then (optionally) stores variables to provide caching and centralized access. These sorts of containers are sometimes mis-described as IOC ("Inversion of Control") Containers. Since they do not provide any control over program flow, the accurate term is DI ("Dependency Injection") Container. The SmartDI Container is unique in that it: * Does not store instantiated objects unnecessarily. * Supports object life-cycle management. When an object dies, it is removed from the container. This requires you to raise a global message. * Supports simple register-and-resolve so types do not need to be registered in advance.


TPL compatible replacement for events and global messages


Xamarin.Forms abstract classes and utilities to support creating flowable animated apps.


Platform independent utilities for C# development.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.5 72 7/30/2022
2.0.4 60 7/29/2022
2.0.3 104 5/16/2022
2.0.2 634 10/29/2021
2.0.1 384 10/28/2021
1.0.37 283 10/28/2021
1.0.36 198 10/28/2021
1.0.34 357 8/27/2021
1.0.33 468 8/24/2021
1.0.32 431 8/17/2021
1.0.30 173 8/16/2021
1.0.29 470 8/14/2021
1.0.28 657 8/10/2021
1.0.27 368 7/5/2021
1.0.26 652 6/24/2021
1.0.24 440 6/2/2021
1.0.22 897 4/7/2021
1.0.21 233 4/6/2021
1.0.20 220 4/6/2021
1.0.19 237 4/2/2021
1.0.18 427 4/1/2021
1.0.17 508 1/30/2021
1.0.16 861 10/28/2020
1.0.15 677 10/28/2020
1.0.14 464 9/11/2020
1.0.13 613 4/22/2020
1.0.12 1,110 10/26/2019
1.0.11 695 7/30/2019
1.0.10 1,134 6/10/2019
1.0.9 489 6/10/2019
1.0.7 1,307 12/25/2018
1.0.5 1,233 12/24/2018
1.0.1 636 12/24/2018
1.0.0 614 12/24/2018