NAudio 3.3.0 Simplifies Windows-Only Target Frameworks in the Meta-Package
NAudio 3.3.0 preview moves the meta-package to a single net9.0 target and marks Windows-only APIs with [SupportedOSPlatform] instead of a -windows TFM. The library is also fully annotated for nullable reference types. Developers targeting plain netX.0 should know the new package layout and the CA1416 warnings it can produce.
Key points
- The NAudio meta-package targets only net9.0 from 3.3.0; the netX.0-windows target is gone.
- Windows-only APIs are marked with [SupportedOSPlatform] instead of a Windows TFM.
- Plain netX.0 Windows apps may see CA1416; fix with a -windows TFM or OperatingSystem.IsWindows().
- NAudio.WinForms and NAudio.Dmo are no longer in the meta-package; NAudio.Asio must be referenced directly.
- Linux and macOS users should reference NAudio.Alsa, NAudio.MacOS or NAudio.SoundFile directly.
- The library is fully nullable-annotated; projects with warnings-as-errors may need code changes.
The NAudio meta-package, the top-level NuGet package that bundles the library's convenience helpers, is being reduced to a single net9.0 target in NAudio 3.3.0. It references NAudio.Core, NAudio.Midi, NAudio.WinMM and NAudio.Wasapi. The previous multi-targeting left plain netX.0-windows consumers with no Windows types at all, so the Windows-only marking moves from the target framework to the [SupportedOSPlatform] attribute. Packages that truly need a -windows target, such as NAudio.WinForms, are dropped from the meta-package, NAudio.Dmo is removed, and NAudio.Asio must be referenced directly.
Windows apps built against plain netX.0 will now see CA1416 analyzer warnings, which can be silenced by targeting -windows, annotating the assembly, or guarding calls with OperatingSystem.IsWindows(). Linux and macOS users should reference the platform-specific sub-packages instead of the meta-package. The release is also fully annotated for nullable reference types, which can break builds that treat warnings as errors. A preview is available now, with the full release planned soon.
Real-world use
- A Windows desktop audio recorder that targets plain netX.0 and now needs OperatingSystem.IsWindows() guards.
- A cross-platform audio processing service on Linux that references NAudio.Core and NAudio.Alsa instead of the meta-package.
- An enterprise project with warnings-as-errors enabled upgrading to NAudio 3.3.0 and fixing new nullability warnings.
Why it matters
Projects targeting plain netX.0 should revisit their package references and add Windows guards. Projects that treat warnings as errors may hit new nullability diagnostics when upgrading.