NebriaChip.Ip.Win 1.1.0

dotnet add package NebriaChip.Ip.Win --version 1.1.0
                    
NuGet\Install-Package NebriaChip.Ip.Win -Version 1.1.0
                    
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="NebriaChip.Ip.Win" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NebriaChip.Ip.Win" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="NebriaChip.Ip.Win" />
                    
Project file
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 NebriaChip.Ip.Win --version 1.1.0
                    
#r "nuget: NebriaChip.Ip.Win, 1.1.0"
                    
#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 NebriaChip.Ip.Win@1.1.0
                    
#: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=NebriaChip.Ip.Win&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=NebriaChip.Ip.Win&version=1.1.0
                    
Install as a Cake Tool

NebriaChip.Ip.Win

NugetShield

This library is a simple wrapper around the Windows API for manipulating temporary IP addresses.
The IP addresses you add are temporary and will be discarded when the system is rebooted or when the network interface is reset.
This can also coexist with the interface’s DHCP-assigned address.
It is intended for scenarios where a temporary IP address is needed, such as testing.

For more details, see CreateUnicastIpAddressEntry.

Examples

Add an IP address and wait for DAD (Duplicate Address Detection) to complete.

using NebriaChip.Ip.Win;

var adapter = "Local Area Connection";
var address = new IPAddress([192, 168, 100, 10]);
var prefix = 24;
var addrOperator = new WinIpAddrOperator(new() { ThrowOnError = true });

addrOperator.CreateUnicastAddress(adapter, address, prefix);

using var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(10));
var state = await addrOperator.WaitDadStateAsync(nwif, address, timeout.Token);
Console.WriteLine($"DAD State: {state}");

Polling-based DAD completion wait.

var state = await addrOperator.PollingDadStateAsync(nwif, address, timeout.Token);

Add an IP address with optimistic DAD (initial state set to Preferred).

await addrOperator.CreateUnicastAddress(adapter, address, prefix, optimistic: true);
Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.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.

Version Downloads Last Updated
1.1.0 110 9/6/2026