Closed centpede closed 9 months ago
The existing statement works correctly and is shorter so I don't know why you want to change it. Yours works too of course but it's longer.
Strange. I got an "CurrentDirectory ist unknown" error.
CurrentDirectory
is a property of the Environment
static class that is imported by the project file:
<ItemGroup>
<Using Include="System.Console" Static="true" />
<Using Include="System.IO.Path" Static="true" />
<Using Include="System.Environment" Static="true" />
</ItemGroup>
You must have missed Step 2 on page 493:
You are right, I've overseen to include System.Environment from Page 493 /2., my fault, sorry!
No worries. I suspect that other readers might too, it's easy to overlook because I do not show the actual markup because I was trying to save space in the book (I'm limited to about 750 pages). I've added an improvement item for this: https://github.com/markjprice/cs12dotnet8/blob/main/docs/errata/improvements.md#page-493---serializing-as-xml
Dear Mark,
possibly
string path = Combine(CurrentDirectory, "people.xml");
should be changed to
string path = Combine(Directory.GetCurrentDirectory(), "people.xml");
The same on page 499, 3.
Thanks, Robin