The error list from lesson M2.2 had six lines, all about data access. Behind them wait places where the compiler says nothing and the program only stumbles at run time. This lesson goes through both kinds, in the order in which the Order Book meets them.
The pattern is always the same. An API is (1) already there in .NET on Windows, (2) there only with a package, (3) changed, or (4) gone altogether. Which of the four kinds it is, a test shows you, not guessing. That is why you built the safety net first.
What is where
Microsoft's documentation names the Windows Compatibility Pack, the package Microsoft.Windows.Compatibility, which adds around 20,000 APIs for
Windows technologies: registry, event log, WMI, performance counters, directory services, Windows services, code pages and more. And it names technologies
that have no replacement in .NET. For the Order Book we checked what compiles on net10.0-windows with UseWindowsForms without any further package:
| API | Order Book | on net10.0-windows |
|---|---|---|
Microsoft.Win32.Registry |
window dimensions (B12) | there without a package |
System.Diagnostics.EventLog |
error messages (B12) | there without a package |
System.Drawing with PrintDocument |
invoice printing (B7) | there without a package |
System.Configuration with ConfigurationManager |
Settings (B2) |
there without a package |
System.Management (WMI) |
not used | needs a package |
ServiceController, SerialPort |
not used | need a package |
System.Data.SqlClient |
data access (B4) | needs a package, and it is a different one |
WebBrowser |
customer card (B9) | there, but built on Internet Explorer |
Encoding.GetEncoding(1252) |
export (B8) | there, but the code page is not registered |
And what no longer exists, according to Microsoft's documentation: application domains (AppDomain.CreateDomain throws PlatformNotSupportedException),
.NET Remoting, Code Access Security, Windows Workflow Foundation and System.EnterpriseServices. Some of these calls compile anyway and
only throw at run time. Look for them early, with a test. The Order Book uses none of them; the module exam has one.