Setting up your development environment for BlockCore-SDK development.
Purpose: C# runtime and development tools
Download: https://dotnet.microsoft.com/download/dotnet/9.0
Verify Installation:
dotnet --version
# Should show: 9.0.xDownload: https://visualstudio.microsoft.com/vs/ Required Workloads:
- .NET desktop development
- ASP.NET and web development (for web-based tools)
Pros: Best C# support, integrated debugging, IntelliSense Cons: Windows only, large download
Download: https://www.jetbrains.com/rider/ Required Plugins: None (C# support built-in)
Pros: Cross-platform, excellent C# support, lightweight Cons: Paid (free trial available)
Download: https://code.visualstudio.com/ Required Extensions:
- C# Dev Kit
- C# Extensions
- GitLens
- PowerShell (for Windows)
Pros: Free, lightweight, cross-platform Cons: Less integrated than full IDEs
Purpose: Version control
Download: https://git-scm.com/
Verify Installation:
git --version
# Should show: git version 2.x.xPurpose: Engine dependency for validation
Installation: Will be added as NuGet package dependency
System.CommandLine: Microsoft's CLI framework
dotnet add package System.CommandLineCommandLineParser: Alternative CLI framework
dotnet add package CommandLineParserHandlebars.Net: Template processing
dotnet add package Handlebars.NetRazorEngine: Razor template engine
dotnet add package RazorEngineSystem.Text.Json: Modern JSON handling
dotnet add package System.Text.JsonNewtonsoft.Json: Legacy JSON library
dotnet add package Newtonsoft.JsonJsonSchema.Net: JSON Schema validation
dotnet add package JsonSchema.NetSharpZipLib: ZIP file creation
dotnet add package SharpZipLibSystem.IO.Compression: Built-in compression
using System.IO.Compression;System.Runtime.InteropServices: Platform detection
using System.Runtime.InteropServices;System.Environment: Environment information
using System.Environment;xUnit: Unit testing
dotnet add package xunit
dotnet add package xunit.runner.visualstudioMoq: Mocking framework
dotnet add package MoqBlockCore-SDK/
├─ src/
│ ├─ BlockCore-SDK.CLI/
│ ├─ BlockCore-SDK.Templates/
│ ├─ BlockCore-SDK.Validation/
│ ├─ BlockCore-SDK.Packaging/
│ └─ BlockCore-SDK.Installation/
├─ tests/
├─ templates/
├─ docs/
└─ BlockCore-SDK.sln
// Program.cs
using System.CommandLine;
var rootCommand = new RootCommand("BlockCore SDK CLI Tool");
var newCommand = new Command("new", "Create new project");
var typeArgument = new Argument<string>("type", "Project type");
var nameArgument = new Argument<string>("name", "Project name");
newCommand.AddArgument(typeArgument);
newCommand.AddArgument(nameArgument);
newCommand.SetHandler((type, name) => {
Console.WriteLine($"Creating {type} project: {name}");
}, typeArgument, nameArgument);
rootCommand.AddCommand(newCommand);
return await rootCommand.InvokeAsync(args);// TemplateEngine.cs
using HandlebarsDotNet;
public class TemplateEngine {
private readonly IHandlebars handlebars;
public TemplateEngine() {
handlebars = Handlebars.Create();
}
public string ProcessTemplate(string template, object data) {
var compiledTemplate = handlebars.Compile(template);
return compiledTemplate(data);
}
}- Shell: PowerShell, cmd.exe
- Path Separator:
\ - Package Manager: Chocolatey
- CLI Tools: Windows Terminal
- Shell: Bash, Zsh
- Path Separator:
/ - Package Manager: apt, yum, pacman
- CLI Tools: Terminal emulator
- Shell: Zsh, Bash
- Path Separator:
/ - Package Manager: Homebrew
- CLI Tools: Terminal.app
- Microsoft CLI Guidelines: https://docs.microsoft.com/en-us/dotnet/standard/commandline/
- Command Line Interface Guidelines: https://clig.dev/
- Unix Philosophy: https://en.wikipedia.org/wiki/Unix_philosophy
- Handlebars Documentation: https://handlebarsjs.com/
- Razor Syntax: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor
- Mustache Templates: https://mustache.github.io/
- JSON Schema Specification: https://json-schema.org/
- Schema Validation: https://json-schema.org/understanding-json-schema/
- Online Validator: https://www.jsonschemavalidator.net/
dotnet new console -n TestApp
cd TestApp
dotnet run
# Should print: Hello, World!// Create simple CLI app
dotnet new console -n TestCLI
cd TestCLI
dotnet add package System.CommandLine// Test Handlebars
dotnet add package Handlebars.Net
// Create simple template test# Test on different platforms
dotnet build
dotnet run -- --help- Install Required Tools: .NET 9 SDK, IDE, Git
- Set up CLI Project: Create basic CLI structure
- Add Dependencies: Install required NuGet packages
- Test Environment: Verify everything works
- Start Learning: v0.1 Learning Guide
"dotnet command not found":
- Add .NET SDK to PATH
- Restart terminal/IDE
"Package restore failed":
- Check internet connection
- Clear NuGet cache:
dotnet nuget locals all --clear
"CLI not responding":
- Check command syntax
- Verify argument parsing
- Test with --help flag
"Template processing failed":
- Check template syntax
- Verify data binding
- Test with simple template
Ready to start coding? Head to v0.1 Learning Guide!