CoreSuite.Connectivity 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package CoreSuite.Connectivity --version 1.0.0
                    
NuGet\Install-Package CoreSuite.Connectivity -Version 1.0.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="CoreSuite.Connectivity" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreSuite.Connectivity" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreSuite.Connectivity" />
                    
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 CoreSuite.Connectivity --version 1.0.0
                    
#r "nuget: CoreSuite.Connectivity, 1.0.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 CoreSuite.Connectivity@1.0.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=CoreSuite.Connectivity&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreSuite.Connectivity&version=1.0.0
                    
Install as a Cake Tool

CoreSuite Connectivity

CoreSuite.Connectivity is a lightweight .NET 8 service for checking internet availability and continuously monitoring connection changes.

It tests multiple well-known HTTPS endpoints and considers connectivity available when at least one responds successfully.

Features

  • Asynchronous and synchronous availability checks.
  • Continuous background monitoring.
  • Configurable monitoring interval.
  • Status-change, connection and disconnection events.
  • No external package dependencies.
  • Predictable cleanup through IDisposable.

Requirements

  • .NET 8 or a compatible target framework

Installation

dotnet add package CoreSuite.Connectivity

Check once

Prefer the asynchronous API:

Using ConnectivityService As New Connectivity()
    Dim IsOnline As Boolean = Await ConnectivityService.IsAvailableAsync()
End Using

The synchronous alternative is:

Dim IsOnline As Boolean = ConnectivityService.IsAvailable()

Monitor continuously

Public Class MainForm
    Private ReadOnly ConnectivityService As New Connectivity()
    Public Sub New()
        InitializeComponent()
        ConnectivityService.MonitoringInterval = TimeSpan.FromSeconds(2)
        AddHandler ConnectivityService.ConnectivityChanged, AddressOf ConnectivityService_ConnectivityChanged
        AddHandler ConnectivityService.Connected, Sub(Sender, E) Debug.WriteLine("Connected")
        AddHandler ConnectivityService.Disconnected, Sub(Sender, E) Debug.WriteLine("Disconnected")
        ConnectivityService.StartMonitoring()
    End Sub
    Private Sub ConnectivityService_ConnectivityChanged(Sender As Object, E As ConnectivityEventArgs)
        Debug.WriteLine($"Internet available: {E.InternetAvailable}")
    End Sub
    Protected Overrides Sub OnFormClosed(E As FormClosedEventArgs)
        ConnectivityService.Dispose()
        MyBase.OnFormClosed(E)
    End Sub
End Class

Properties

Property Type Default Description
MonitoringInterval TimeSpan 1 second Delay between monitoring checks.
IsMonitoring Boolean Read-only Whether continuous monitoring is active.
IsConnected Boolean Read-only Last stored monitoring status.

Methods

Method Description
IsAvailableAsync() Performs a fresh asynchronous availability check.
IsAvailable() Performs a fresh synchronous check.
StartMonitoring() Starts background monitoring.
StopMonitoring() Stops background monitoring.
Dispose() Stops monitoring and releases resources.

Events

Event Raised when
ConnectivityChanged The detected status changes. InternetAvailable contains the new state.
Connected Status changes to available.
Disconnected Status changes to unavailable.

Important behavior

  • Availability of one tested endpoint does not guarantee every internet service is reachable.
  • IsConnected is the stored monitoring state. Use IsAvailableAsync() for a fresh result.
  • Monitoring events may run outside the UI thread. Marshal UI changes when required.
  • Set MonitoringInterval to a positive value.
  • Dispose long-lived instances when their owner shuts down.

License

MIT License.

Repository

CoreSuite on GitHub

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on CoreSuite.Connectivity:

Package Downloads
CoreSuite.ExceptionReporter

UI-independent .NET 8 service for capturing, serializing, saving and emailing structured exception reports.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 147 8/2/2026
1.0.1 118 8/2/2026
1.0.0 111 8/2/2026

Initial release of the Connectivity service.