LINQPad 5 gets .NET 8 code
Hi,
I noticed recently that using the _implement _ dropdown helper in LINQPad 5(.48) brings in .NET 8 code. A second part to this, that repros with this scenario, is that the injected using get's added to the bottom of the file instead of in the background.
Steps to repro are as follows:
- Open new query
- Add Newtonsoft.Json package (currently 13.0.3)
- Add using for Newtonsoft.Json
- Add class and inherit from JsonConverter
- Hit context menu on class and implement members
- Observe NullableAttributes and using at bottom of file
Do let me know if you need any other details.
Best regards
John
PS The forum editor doesn't appear to be respecting any markdown (at least in preview)
Comments
(Ok, just in preview then the space after implement is my fault obviously)
I don't know about the second issue, but the first isn't really a problem with LinqPad, but with the Newtonsoft.Json package which uses this attribute which is included in their dll. Unfortunately it is internal and so is not visible to your query.
Thanks for the reply. I see that the source code uses the nullable reference types but is it the compiler that adds the NullableAttribute?
https://github.com/JamesNK/Newtonsoft.Json/blob/master/Src/Newtonsoft.Json/JsonConverter.cs
Thanks for the report - I'll get a fix into the next LINQPad 5 release.