A .NET guideline specifies that an application should never throw a NullReferenceException
. However, many applications and libraries do. The NullReferenceException
is the most common exception happening. That’s why C# 8 tries to get rid of it. With C# 8, reference types are not null be default. This is a big change, and a great feature. However, what about all the legacy code? Can old libraries be used with C# 8 applications, and can C# 7 applications make use of C# 8 libraries?
This article demonstrates how C# 8 allows mixing old and new assemblies.