More info here: https://github.com/dotnet/runtime/issues/62840
Jason S. Clary
commented
Do you know if the requirements changed since .NET 6 was released? I can add the experimental package, EnablePreviewFeatures and LangVersion but I can't build due to complaints about the interfaces not being defined. They aren't in System, System.Numerics or System.Runtime and a System.Runtime.Experimental namespace doesn't exist. I've tried adding the package both with the specific preview version you and Tanner Gooding (on devblogs.microsoft.com) specify and just with 6.0.0 which is what you get if you use dotnet add package without a version. Tanner doesn't specify any using statements at all and you only seem to specify ones required for unrelated classes used in the examples which doesn't seem right unless it was previously in System. I'd have posted on Tanner's blog post but comments were closed at some point prior to release. I'm not finding any other posts about this feature besides yours and Tanner's.
This is rather a shame as I've basically been waiting for this feature for about a decade. I do a lot of work with unusual numeric types and typically have to resort to C++ or jump through insane and inefficient hoops to make things work in C#. I'm really hoping this gets added to F# as well. At some point I may break down and write my own language since I also need user-defined infix operators to avoid a ton of long fluent method call chains that are hard to read and debug. Once you move beyond the limits of the Real numbers, there are at least four different types of multiplication (interior, exterior/cross, inner/dot and outer) and that's assuming you stick to euclidean space. Lots of other things get complicated in higher dimensions and other metric spaces.
3 comments on this page
Bill
Great explanation. Thank you.
Steve Dunn
Jason - apparently, this was broken in .NET 6.0.101. One of the known workarounds is to add this global.json file:
Jason S. Clary
Do you know if the requirements changed since .NET 6 was released? I can add the experimental package, EnablePreviewFeatures and LangVersion but I can't build due to complaints about the interfaces not being defined. They aren't in System, System.Numerics or System.Runtime and a System.Runtime.Experimental namespace doesn't exist. I've tried adding the package both with the specific preview version you and Tanner Gooding (on devblogs.microsoft.com) specify and just with 6.0.0 which is what you get if you use dotnet add package without a version. Tanner doesn't specify any using statements at all and you only seem to specify ones required for unrelated classes used in the examples which doesn't seem right unless it was previously in System. I'd have posted on Tanner's blog post but comments were closed at some point prior to release. I'm not finding any other posts about this feature besides yours and Tanner's.
This is rather a shame as I've basically been waiting for this feature for about a decade. I do a lot of work with unusual numeric types and typically have to resort to C++ or jump through insane and inefficient hoops to make things work in C#. I'm really hoping this gets added to F# as well. At some point I may break down and write my own language since I also need user-defined infix operators to avoid a ton of long fluent method call chains that are hard to read and debug. Once you move beyond the limits of the Real numbers, there are at least four different types of multiplication (interior, exterior/cross, inner/dot and outer) and that's assuming you stick to euclidean space. Lots of other things get complicated in higher dimensions and other metric spaces.