C# 8

  • Thread starter Thread starter Bob Bryan
  • Start date Start date
B

Bob Bryan

Guest
I would like to start experimenting with C#8. But, am not quite sure how to do that. These are my questions:

1. I have read several articles on C# 8. Most of these articles claim that a .NET Core 3 project is required to use C# 8. I don't see anything about any .NET Framework, including 4.8, that will support C# 8. Are there any plans to support C# 8 with .NET Framework 4.8 or any other .NET Framework version?

2. I downloaded Visual Studio 2019 Community Edition, which includes 4.72 of the .NET Framework. I tried specifying 4.72 as the project framework and added the following interface method, that includes a default method implementation:

interface ITestMethodDefault { // This interface tests out the new default method that may now be supplied for an interface method. // void Method1(); void Log(Exception ex) => Log(LogLevel.Error, ex.ToString()); // New overload } }


This code was taken from Mads Torgersen's blog. The problem is that it generates a compilation error:

CS0531 C# : interface members cannot have a definition

Under Project Properties / Build / Advanced Settings, I tried building with both the latest version and the 8.0 beta preview version with the same result.

I have also read that some areas of functionality will only be supported by .NET Core 3. So, my question here is - will this functionality be supported by the .NET Framework at some point? If so, then when and what version? Is there a matrix somewhere that shows the C# 8 functionality that will be supported by .NET Core and the .NET Framework?

3. Finally, my last question has to do with what some in the industry are describing as the changing of the guard, so to speak.The fact that Microsoft is providing C# 8 functionality for .NET Core, without even mentioning any kind of support for it in the .NET Framework does not seem to bode well for the future of the .NET Framework. I have read more than one article that claims that the .NET Framework is dead or at least that 4.8 will be one of the last ones to be released. These same articles suggest that new projects should only be implemented with .NET Core. So, has Microsoft decided that the .NET Framework will be retired at some point and that all new development should be implemented with .NET Core - either now or some point in the future?

Continue reading...
 
Back
Top