Testing C# 9.0 in VS2019 – CS0518 IsExternalInit is not defined or imported … How do I define/import it?

This is a bug in the current preview and the latest master branch (June 27). A simple record in sharplab.io creates the same error.

Just add the missing type somewhere in your project

using System.ComponentModel;

namespace System.Runtime.CompilerServices
{
    [EditorBrowsable(EditorBrowsableState.Never)]
    internal class IsExternalInit{}
}

Records and init will work without problem.

Only LinqPad 6 seems to work without problems, probably because it includes that type too

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)