Class DotnetOperations
- Namespace
- Ando.Operations
- Assembly
- ando.dll
Provides .NET CLI operations for build scripts. Methods register steps in the workflow rather than executing immediately.
public class DotnetOperations : OperationsBase
- Inheritance
-
DotnetOperations
- Inherited Members
Constructors
DotnetOperations(StepRegistry, IBuildLogger, Func<ICommandExecutor>, DotnetSdkEnsurer?)
Provides .NET CLI operations for build scripts. Methods register steps in the workflow rather than executing immediately.
public DotnetOperations(StepRegistry registry, IBuildLogger logger, Func<ICommandExecutor> executorFactory, DotnetSdkEnsurer? sdkEnsurer = null)
Parameters
registryStepRegistryloggerIBuildLoggerexecutorFactoryFunc<ICommandExecutor>sdkEnsurerDotnetSdkEnsurer
Methods
Build(ProjectRef, Action<DotnetBuildOptions>?)
Registers a 'dotnet build' step to compile the project.
public void Build(ProjectRef project, Action<DotnetBuildOptions>? configure = null)
Parameters
projectProjectRefconfigureAction<DotnetBuildOptions>
Project(string)
Creates a .NET project reference from a path. Usage: var app = Dotnet.Project("./src/MyApp/MyApp.csproj");
public ProjectRef Project(string path)
Parameters
pathstringPath to the .csproj file.
Returns
Publish(ProjectRef, Action<DotnetPublishOptions>?)
Registers a 'dotnet publish' step to create deployment artifacts.
public void Publish(ProjectRef project, Action<DotnetPublishOptions>? configure = null)
Parameters
projectProjectRefconfigureAction<DotnetPublishOptions>
Restore(ProjectRef, Action<DotnetRestoreOptions>?)
Registers a 'dotnet restore' step to restore NuGet packages.
public void Restore(ProjectRef project, Action<DotnetRestoreOptions>? configure = null)
Parameters
projectProjectRefconfigureAction<DotnetRestoreOptions>
SdkInstall(string)
Installs .NET SDK globally using Microsoft's install script. Use this when building in a base image that doesn't have .NET pre-installed. Calling this method disables automatic SDK installation for subsequent operations.
public void SdkInstall(string version = "9.0")
Parameters
versionstringSDK version (e.g., "9.0", "8.0"). Defaults to "9.0".
Test(ProjectRef, Action<DotnetTestOptions>?)
Registers a 'dotnet test' step to run unit tests.
public void Test(ProjectRef project, Action<DotnetTestOptions>? configure = null)
Parameters
projectProjectRefconfigureAction<DotnetTestOptions>
Tool(string, string?)
Creates a reference to a .NET CLI tool for installation.
public DotnetTool Tool(string packageId, string? version = null)