Thanks for the comment. Is this perhaps on a particular version of .NET when trying to go back far enough?
I have an example repository available here that I used for the article and the video: GitHub Repo[^]
And it's entirely functional without what you've mentioned. If you note the csproj file, I only have the language version tweaked and the nuget package I discuss in the article added.
I was using .NET framework 4.8, and set langversion to 11.0 (also tried 9.0, 10.0 and 'latest'). As far as I can discover this is necessary for all framework versions, and .NET core before 5.0.
I'm really not sure what to say given that the github repository I linked to doesn't have this set and was used to put together what I have in the screenshot (as evidence of it working without it).
Are you using the PolySharp nuget package or are you doing something else that requires you to have this set?
I am using C# compiler version 4.4.0-6.22608.27, with NET Framework 4.8. The compile happily supports C# versions up to 11.0, but the framework does not.
And the reason why the mentioned "fix" is necessary is explained in the following report to Microsoft: Visual Studio Feedback[^]. It is interestibng that they create an incompatibility in the compiler/framework, but then do not accept that it is a bug.
It is interestibng that they create an incompatibility in the compiler/framework, but then do not accept that it is a bug.
Is it not what they have been doing for a couple of years? "It is not a bug, it is a (collateral) feature"
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
This is why I was confused by the original comment thread here:
From article:
If we inspect the RequiredMemberAttribute and IsExternalInit, we can see they were generated by PolySharp
So IsExternalInit should already be generated by PolySharp. So if Richard was using PolySharp as my article explained, then I am not sure why it would not be functioning. (i.e. this is one of the main reasons to use the nuget package so that we don't need to go do that )
Last Visit: 31-Dec-99 18:00 Last Update: 12-May-24 21:18