ViceSharp.SourceGen 1.1.0

dotnet add package ViceSharp.SourceGen --version 1.1.0
                    
NuGet\Install-Package ViceSharp.SourceGen -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="ViceSharp.SourceGen" Version="1.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ViceSharp.SourceGen" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ViceSharp.SourceGen">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 ViceSharp.SourceGen --version 1.1.0
                    
#r "nuget: ViceSharp.SourceGen, 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 ViceSharp.SourceGen@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=ViceSharp.SourceGen&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ViceSharp.SourceGen&version=1.1.0
                    
Install as a Cake Tool

ViceSharp.SourceGen

A Roslyn source generator that emits device-registration boilerplate at compile time, replacing runtime reflection on the emulator hot path.

What it is

ViceSharp.SourceGen is a compile-time analyzer package (a Roslyn IIncrementalGenerator), not a runtime library or a dotnet tool. It scans for classes marked with ViceSharpDeviceAttribute and generates a partial-class Register() and Create() pair for each one, so device wiring is resolved by the compiler instead of by reflection at startup. The package ships as a development dependency: its assembly goes to analyzers/dotnet/cs and carries no runtime payload. It is part of ViceSharp, a C#/.NET 10 port of the VICE Commodore 64 emulator.

Install

dotnet add package ViceSharp.SourceGen

The generator activates automatically during build once referenced; there is no command to run.

Usage

Mark a partial device class with the attribute, and the generator emits its registration and factory members:

[ViceSharpDevice(role: 0)]
public partial class MyDevice : IDevice
{
    public static partial void Register();
}

Notes

This is a build-time-only analyzer package with no runtime code; it produces source, not a library you call into. The generated Register() and Create() members reference ViceSharp.Core and ViceSharp.Abstractions, so consuming projects reference those packages as usual.

License: GPL-2.0-or-later (derivative of VICE). Part of the ViceSharp project: https://github.com/sharpninja/vice-sharp

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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 83 7/11/2026
1.0.5 91 7/10/2026
1.0.4 83 7/10/2026
1.0.2 97 7/8/2026
1.0.1 105 7/8/2026
0.9.0 95 7/2/2026