WOLSharp 1.2.1
dotnet add package WOLSharp --version 1.2.1
NuGet\Install-Package WOLSharp -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WOLSharp" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WOLSharp" Version="1.2.1" />
<PackageReference Include="WOLSharp" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WOLSharp --version 1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WOLSharp, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WOLSharp@1.2.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WOLSharp&version=1.2.1
#tool nuget:?package=WOLSharp&version=1.2.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WOLSharp
Interop helpers for sending Wake‑on‑LAN (WOL) magic packets to wake machines on your network.
Why WOLSharp?
- Dead‑simple API — one call to broadcast a magic packet.
- .NET Standard 2.0 — works on .NET Framework 4.6.1+, .NET Core 2.0+, and modern .NET.
Install
# Package Id
WOLSharp
# dotnet CLI
dotnet add package WOLSharp
# Package Manager
Install-Package WOLSharp
Quick start
using System.Net.NetworkInformation;
using WOLSharp;
// Create a socket (will broadcast)
using var wol = new WOLSocket();
// Send using a string MAC (accepted: AA-BB-CC-DD-EE-FF, AA:BB:CC:DD:EE:FF, or AABBCCDDEEFF)
wol.Broadcast("01-23-45-67-89-AB");
// Or using PhysicalAddress
var mac = PhysicalAddress.Parse("0123456789AB");
wol.Broadcast(mac);
Heads‑up: WOL uses UDP broadcast (commonly port 9 or 7). Ensure your NIC/BIOS/UEFI and OS power settings allow Wake‑on‑LAN and that your network permits directed or global broadcast.
What’s a magic packet?
A WOL magic packet is:
- 6 bytes of
0xFF - followed by your 6‑byte MAC repeated 16 times
Total length: 102 bytes.
FF FF FF FF FF FF <mac x16>
Troubleshooting
No wake?
- Enable WOL in BIOS/UEFI and in the NIC’s driver settings ("Wake on Magic Packet").
- Some systems only wake from S3/S4, not from full power‑off (S5).
- On Windows, uncheck “Allow the computer to turn off this device to save power” for the NIC if needed.
Across subnets/VLANs: you may need a router that permits directed broadcast or a WOL relay/proxy.
Notes
- WOL is unauthenticated by design. Don’t expose a “wake anything” endpoint to untrusted networks.
- Some NICs require "Wake on Magic Packet only" to be enabled.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.