Solo 1.0.0-alpha.1

This is a prerelease version of Solo.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Solo --version 1.0.0-alpha.1                
NuGet\Install-Package Solo -Version 1.0.0-alpha.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="Solo" Version="1.0.0-alpha.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Solo --version 1.0.0-alpha.1                
#r "nuget: Solo, 1.0.0-alpha.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.
// Install Solo as a Cake Addin
#addin nuget:?package=Solo&version=1.0.0-alpha.1&prerelease

// Install Solo as a Cake Tool
#tool nuget:?package=Solo&version=1.0.0-alpha.1&prerelease                

Solo

A simple library to run a .NET app as single-instance and notify the existing instance, if any.

When the first instance of the app starts, it attempts to create a named pipe.

  • If the named pipe already exists, it means another instance of the app already exists. Solo then connects to the existing named pipe, and sends the arguments to the existing instance, so that it can react appropriately.
  • If it doesn't, the app can start normally. Solo waits for connections from other instances to receive their arguments.

Getting started

Install the package, and add this at the beginning of your Main method (or directly in Program.cs, if using top-level statements):

using var singleInstanceApp = new SingleInstanceApp(
    "MyTestApp",
    args => Console.WriteLine("New instance started!"));
if (!singleInstanceApp.TryStart(args))
{
    return;
}

// The rest of your code goes here

The delegate passed to the SingleInstanceApp constructor is invoked when another instance of the app is started.

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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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.0.0-alpha.2 76 2/20/2024
1.0.0-alpha.1 84 1/2/2024