I'm trying to use a feature that was added in C# 11 (static virtual members in interfaces) and my project targets .NET 9.0, so it should be on C#12, but I'm still getting a CS8926 error. If I manually set my target framework to .NET 7.0 (which is C# 11), it works! If I manually specify
<LangVersion>11.0</LangVersion>
<LangVersion>11.0</LangVersion>
it also works, but specifying 12.0 causes the error again.
Are features from C#11 not usable in C#12+? I feel like they should
For reference, this is my code:
public interface FileUtils<Output>{ public static Output LoadFile(string filePath) => LoadFile(new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)); // CS8926 on LoadFile public abstract static Output LoadFile(Stream fileData);}
public interface FileUtils<Output>{ public static Output LoadFile(string filePath) => LoadFile(new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read)); // CS8926 on LoadFile public abstract static Output LoadFile(Stream fileData);}