Hi all, I'm working in a project that multi-targets net461, net461, net6.0, and net7.0. On the net461 target, I'm encountering an error stating "Predefined type 'System.Runtime.CompilerServices.IsExternalInit' is not defined or imported." The
IsExternalInit
IsExternalInit
nuget package is installed.
StackOverflow suggested that I can create a custom internal class like so:
namespace System.Runtime.CompilerServices{ internal static class IsExternalInit {}}
namespace System.Runtime.CompilerServices{ internal static class IsExternalInit {}}
Adding this class does not get rid of the error, but it does add a new error saying "The namespace 'System.Runtime.CompilerServices.' already contains a definition for 'IsExternalInit'." So it both can't find it and reports a duplicate at the same time. Restarting Visual Studio and deleting obj, bin, and output folders does not resolve the issue.