Sitelet https://github.com/NodeOps-app/createos-csharp-sdk/tree/main/examples
Skip to content

Latest commit

 

History

History

C# SDK examples

These projects demonstrate the same API surfaces as the Go SDK examples. Each project is independently runnable and references the SDK source project by default, so no published package is required for local development.

Set CREATEOS_API_KEY in your shell or secret manager, then run an example from the repository root:

dotnet run --project examples/HelloWorld/HelloWorld.csproj

To use a published package from nuget.org instead of the local project, set CreateOSPackageVersion to the release you want to test:

CreateOSPackageVersion=YOUR_VERSION dotnet run --project examples/HelloWorld/HelloWorld.csproj

This switch applies to every example project, including ExecutionServer; unset it to return to the local project reference. No CreateOS API key belongs in the repository.

Example What it demonstrates
HelloWorld Create a sandbox, run a command, destroy it
CommandStreaming Read command output as it arrives
FilesAndSnapshots Upload/download files and snapshot a sandbox
IngressPreview Expose a service through an ingress preview URL
Network Connect sandboxes on a private network
CustomTemplate Build and use a custom template
ManagedProcess Manage a long-running process
Desktop Desktop automation and noVNC
ExecutionServer HTTP service that executes requests in fresh sandboxes
Readme Several README flows in one program

All examples make live API calls and may create billable resources. They clean up resources in finally blocks, but check your account for leftovers after an interrupted run.