Predefined type ‘System.Runtime.CompilerServices.IsExternalInit’ is not defined or imported [duplicate]

This is a small bug in Visual Studio 2019 that hasn’t been fixed yet. To solve this, you need to add a dummy class named IsExternalInit with the namespace System.Runtime.CompilerServices anywhere in your project. That will do it. If writing a library it’s best to make this class internal, as otherwise you can end up … Read more