markjprice / cs11dotnet7

Repository for the Packt Publishing book titled "C# 11 and .NET 7 - Modern Cross-Platform Development Fundamentals" by Mark J. Price
566 stars 206 forks source link

Page 244 init-only properties #71

Closed DrAvriLev closed 1 year ago

DrAvriLev commented 1 year ago

Here you ask to create a new cs file under PacktLibraryNetStandart2 project. However, the init keyword does not work in .Net 2.

Chapter: 05 Page Number: 244 Section Title: working with records Step Number: 1 Problem to fix: target .NET 2 Suggested solution: I moved the file under the PacktLibraryModern that targets .NET 7. There it's working correctly. Other useful information e.g. OS, coding tools, and so on:

markjprice commented 1 year ago

This is already in the errata here: https://github.com/markjprice/cs11dotnet7/blob/main/docs/errata/errata.md#page-244---init-only-properties