Kittitas.SDK 0.0.3-alpha

This is a prerelease version of Kittitas.SDK.
There is a newer prerelease version of this package available.
See the version list below for details.
<Sdk Name="Kittitas.SDK" Version="0.0.3-alpha" />
For projects that support Sdk, copy this XML node into the project file to reference the package.

Kittitas - Roslyn compiler host

Kittitas is a dotnet global tool that hosts the Roslyn and MSBuild APIs in a single process, making it easier to debug components that run in the roslyn compiler pipeline, such as Analyzers and Source Generators.

Nuget GitHub

Installation

Kittitas is distributed as a dotnet global tool. Simply run the following command to install:

dotnet tool install --global kittitas --version 0.0.3-alpha

Usage

Either pass the name of the project you want to build:

dotnet kittitas <projectFile.csproj>

Or run kittitas from a directory containing a single .csproj

cd projectDir
dotnet kittitas

Kittitas supports options that make attaching a debugger easier. Run dotnet kittitas --help to see a full list of options.

Usage:
  Kittitas [options] [<ProjectFile>]

Arguments:
  <ProjectFile>    The project file to build, or empty to build from the current directory. [default: ]

Options:
  -w, --wait        Waits for a debugger to attach before continuing [default: False]
  -a, --attach      Attempts to attach a debugger before continuing [default: False]
  --version         Show version information
  -?, -h, --help    Show help and usage information

Kittitas.SDK

Kittitas include an MSBuild SDK designed to make running Kittitas from Visual Studio easier.

To use the SDK, create an empty .csproj alongside the project you want to run Kittitas on. Add the following contents into the newly created project file:

<Project Sdk="Kittitas.SDK/0.0.3-alpha">
  <ItemGroup>
    <ProjectReference Include="YourApp.csproj" />
  </ItemGroup>
</Project>

Replacing YourApp.csproj with the path to the project you want to run Kittitas with.

This will create a launchSettings.json under the hood that is configured to start Kittitas with the specified project. Selecting the newly added project as the startup project will add a DebugRoslynComponent debug target.

DebugRoslynComponent debug target inside Visual Studio 2019

This will run Kittitas against the specified project, without actually building anything first, allowing you to debug the build process itself.

FAQs

Whats the difference between this and dotnet build / mbuild.exe / csc.exe: Kittitas isn't designed to replace builds performed by the regular tools, but as a supplementary tool to make it easier to debug components that run inside of them.

Where is the output?: Kittitas doesn't currently produce any output, all compilation is performed in-memory.

Why are builds slower?: Kittitas doesn't use the compiler server or parallel build nodes; by design everything runs in a single process to make debugging easier.

My build failed under Kittitas: Kittitas uses the MSBuild and Roslyn APIs with defaults and without any particular intelligence. Customized or complicated projects may cause the build to fail. Please file an issue or PR if you come across a project that fails under Kittitas.

Why the custom SDK / empty project?: Visual Studio will build an out of date project before launching it in the debugger. Roslyn components (especially source generators) can themselves cause build failures, leading to a chicken and egg situation where you want to debug the failing component but can't start Kittitas because of the failure you want to debug. The Kittitas SDK removes all build targets from the empty project, meaning it will always successfully 'build' instantaneously, and allow you to debug the build of the project you're actually interested in.

Whats with the name?: Kittitas is the name of the county in WA that contains Roslyn. Get it?

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • net5.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
0.0.5-alpha 582 12/9/2020
0.0.4-alpha 193 12/7/2020
0.0.3-alpha 326 9/2/2020
0.0.2-alpha 259 9/1/2020