Updated C# and .NET docs supplement (markdown)

James Groom 2024-02-02 01:24:58 +10:00
parent 3b86419d6f
commit dbbef8108d
1 changed files with 6 additions and 0 deletions

@ -38,6 +38,12 @@ On (older versions of?) VS, `Condition` is ignored if placed on a property/item.
When `<Import/>`ing a `.props` file, `ProjectDir` is unset <!-- TODO only during property evaluation? --> (but `SolutionDir` *is* set, if applicable).
Use `MSBuildProjectDirectory`. Note that the latter doesn't include a trailing slash.
## `Newtonsoft.Json` footguns
`byte[]` is [*intentionally hardcoded*](https://github.com/JamesNK/Newtonsoft.Json/issues/1869#issuecomment-429588794) to serialise to a base64 string (as opposed to a list, like `short[]`, `int[]`, etc. are). The only workaround is to implement `JsonConverter` ([already done](https://github.com/TASEmulators/BizHawk/blob/484e1fee7805c3b54b606290a4dd45ad842df4d2/src/BizHawk.Emulation.Common/U8ArrayAsNormalJSONListConverter.cs#L23)), then either [mark the field/prop](https://github.com/TASEmulators/BizHawk/blob/484e1fee7805c3b54b606290a4dd45ad842df4d2/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.ISettable.cs#L65), or pass [this](https://github.com/TASEmulators/BizHawk/blob/484e1fee7805c3b54b606290a4dd45ad842df4d2/src/BizHawk.Emulation.Common/U8ArrayAsNormalJSONListConverter.cs#L12) in the serialiser settings. (This behaviour [also made it into `System.Text.Json`](https://github.com/dotnet/runtime/issues/89024#issuecomment-1638489257).)
If a string literal contains a date, *even if it's being deserialised to a string*, it will first be [deserialised to a date, timezone-corrected, and re-serialised](https://github.com/JamesNK/Newtonsoft.Json/issues/862).
## NuGet resources are all for old CLI
[up-to-date docs on MSDN](https://learn.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli)