SharpTS.Sdk 1.0.7

dotnet add package SharpTS.Sdk --version 1.0.7
                    
NuGet\Install-Package SharpTS.Sdk -Version 1.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpTS.Sdk" Version="1.0.7">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpTS.Sdk" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="SharpTS.Sdk">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpTS.Sdk --version 1.0.7
                    
#r "nuget: SharpTS.Sdk, 1.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SharpTS.Sdk@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpTS.Sdk&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=SharpTS.Sdk&version=1.0.7
                    
Install as a Cake Tool

SharpTS.Sdk

MSBuild SDK for compiling TypeScript directly to .NET assemblies using SharpTS.

Quick Start

Create a new project file:

<Project Sdk="SharpTS.Sdk/1.0.0">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <SharpTSEntryPoint>src/main.ts</SharpTSEntryPoint>
  </PropertyGroup>
</Project>

Build your project:

dotnet build

Features

  • Compiles TypeScript directly to .NET IL (no JavaScript intermediate)
  • Automatic import discovery via ModuleResolver
  • tsconfig.json integration
  • Standard MSBuild commands (dotnet build, dotnet clean)
  • MSBuild-compatible error output for IDE integration

MSBuild Properties

Property Description Default
SharpTSEntryPoint Entry point TypeScript file (required) (none)
SharpTSOutputPath Output directory for compiled DLL $(OutputPath)
SharpTSOutputFileName Output filename $(AssemblyName).dll
SharpTSTsConfigPath Path to tsconfig.json $(MSBuildProjectDirectory)\tsconfig.json
SharpTSPreserveConstEnums Preserve const enum declarations false
SharpTSExperimentalDecorators Enable legacy (Stage 2) decorators false
SharpTSDecorators Enable TC39 Stage 3 decorators false
SharpTSEmitDecoratorMetadata Emit decorator metadata false
SharpTSVerifyIL Verify generated IL false
SharpTSUseReferenceAssemblies Use reference assembly mode false

tsconfig.json Integration

The SDK automatically reads tsconfig.json if present. Supported options:

tsconfig.json Maps to
compilerOptions.preserveConstEnums SharpTSPreserveConstEnums
compilerOptions.experimentalDecorators SharpTSExperimentalDecorators
compilerOptions.decorators SharpTSDecorators
compilerOptions.emitDecoratorMetadata SharpTSEmitDecoratorMetadata
files[0] SharpTSEntryPoint (if not set)

MSBuild properties take precedence over tsconfig.json values.

Example Projects

Minimal Project

<Project Sdk="SharpTS.Sdk/1.0.0">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <SharpTSEntryPoint>src/main.ts</SharpTSEntryPoint>
  </PropertyGroup>
</Project>

With Decorators

<Project Sdk="SharpTS.Sdk/1.0.0">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    <SharpTSEntryPoint>src/app.ts</SharpTSEntryPoint>
    <SharpTSDecorators>true</SharpTSDecorators>
    <SharpTSEmitDecoratorMetadata>true</SharpTSEmitDecoratorMetadata>
  </PropertyGroup>
</Project>

With tsconfig.json

Project structure:

myproject/
├── myproject.csproj
├── tsconfig.json
└── src/
    └── main.ts

myproject.csproj:

<Project Sdk="SharpTS.Sdk/1.0.0">
  <PropertyGroup>
    <TargetFramework>net10.0</TargetFramework>
    
  </PropertyGroup>
</Project>

tsconfig.json:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "strict": true,
    "preserveConstEnums": true
  },
  "files": ["src/main.ts"]
}

Version Specification

You can pin the SDK version in global.json:

{
  "msbuild-sdks": {
    "SharpTS.Sdk": "1.0.0"
  }
}

Build Commands

# Build the project
dotnet build

# Clean output files
dotnet clean

# Publish
dotnet publish

# Build in Release mode
dotnet build -c Release

Error Codes

Code Category Description
SHARPTS000 General Unclassified error
SHARPTS001 Type Error Type mismatch, invalid assignment
SHARPTS002 Parse Error Syntax error, unexpected token
SHARPTS003 Module Error Import not found, circular dependency
SHARPTS004 Compile Error IL emission failure
SHARPTS005 Config Error Invalid configuration

System Requirements

  • .NET 10 SDK or later (required for building projects)
  • Visual Studio 2026 18.0+ (recommended for IDE support)
  • MSBuild 18.0+ (included with .NET 10 SDK)

SharpTS.Sdk targets .NET 10 directly for optimal performance and modern features.

License

MIT License - see the main SharpTS repository for details.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has 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
1.0.7 99 2/5/2026
1.0.6 107 1/23/2026
1.0.5 98 1/17/2026
1.0.4 100 1/11/2026
1.0.0 121 1/8/2026