csharp

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package csharp provides a C# builder that downloads .NET SDK toolchains from Microsoft.

Only .NET 8.x and above are supported. The builder uses native AOT compilation (dotnet publish) to produce a self-contained binary.

Import this package for its side effects to register the builder:

import _ "github.com/Highload-fun/builders/csharp"

Index

Constants

View Source
const BuilderId = "csharp"

BuilderId is the identifier used to register and look up this builder.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSharp

type CSharp struct {
	// contains filtered or unexported fields
}

CSharp implements builders.Builder for the C# programming language via the .NET SDK.

func (*CSharp) Build

func (c *CSharp) Build(ctx context.Context, sb *sandbox.Sandbox, version string, flags []string) error

Build compiles C# source code inside the sandbox using "dotnet publish" with native AOT. If version is empty, "8.0.0" is used. The .NET SDK is downloaded on demand and cached in builders.CompilersHostDir.

func (*CSharp) GetVersions

func (c *CSharp) GetVersions(ctx context.Context) ([]builders.Version, error)

GetVersions fetches available .NET SDK versions from the dotnet releases-index.json API. Only channels with major version >= 8 are included. Results are cached for 1 hour.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL