CodeBridge.MSBuild
1.0.0
dotnet add package CodeBridge.MSBuild --version 1.0.0
NuGet\Install-Package CodeBridge.MSBuild -Version 1.0.0
<PackageReference Include="CodeBridge.MSBuild" Version="1.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="CodeBridge.MSBuild" Version="1.0.0" />
<PackageReference Include="CodeBridge.MSBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add CodeBridge.MSBuild --version 1.0.0
#r "nuget: CodeBridge.MSBuild, 1.0.0"
#:package CodeBridge.MSBuild@1.0.0
#addin nuget:?package=CodeBridge.MSBuild&version=1.0.0
#tool nuget:?package=CodeBridge.MSBuild&version=1.0.0
CodeBridge MSBuild Integration
This package provides MSBuild integration for CodeBridge, allowing automatic SDK generation during build.
Installation
dotnet add package CodeBridge.MSBuild
Usage
Automatic Integration
Once installed, CodeBridge will automatically run during build if a codebridge.json file exists in your project directory.
Configuration
Control CodeBridge behavior via MSBuild properties:
<PropertyGroup>
<CodeBridgeEnabled>true</CodeBridgeEnabled>
<CodeBridgeConfigFile>$(MSBuildProjectDirectory)\codebridge.json</CodeBridgeConfigFile>
<CodeBridgeBuildEvent>BeforeBuild</CodeBridgeBuildEvent>
<CodeBridgeIncremental>true</CodeBridgeIncremental>
<CodeBridgeVerbose>false</CodeBridgeVerbose>
</PropertyGroup>
Manual Generation
Generate SDK manually using MSBuild target:
dotnet msbuild /t:CodeBridgeGenerate
Disable for Specific Configurations
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<CodeBridgeEnabled>false</CodeBridgeEnabled>
</PropertyGroup>
Build Events
- BeforeBuild: Generate SDK before compilation (default)
- AfterBuild: Generate SDK after successful build
- Manual: Only generate when explicitly called
Features
- ✅ Automatic generation during build
- ✅ Incremental generation (skip if no changes)
- ✅ Configurable build events
- ✅ Verbose logging support
- ✅ Manual generation target
- ✅ Clean integration (removes generated files)
- ✅ Cancellation support (Ctrl+C)
Example
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CodeBridge.MSBuild" Version="1.0.0" />
</ItemGroup>
<PropertyGroup>
<CodeBridgeBuildEvent>AfterBuild</CodeBridgeBuildEvent>
<CodeBridgeVerbose>true</CodeBridgeVerbose>
</PropertyGroup>
</Project>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
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.0 | 181 | 10/10/2025 |
| 1.0.0-preview.8 | 134 | 10/9/2025 |
| 1.0.0-preview.7 | 136 | 10/9/2025 |
| 1.0.0-preview.6 | 139 | 10/9/2025 |
| 1.0.0-preview.5 | 131 | 10/9/2025 |
| 0.0.4 | 174 | 10/9/2025 |
| 0.0.3 | 177 | 10/9/2025 |
| 0.0.2 | 168 | 10/9/2025 |
| 0.0.1 | 195 | 10/2/2025 |
v1.0.0: First stable release! 🎉
Major Features:
- ✅ Complete TypeScript SDK generation from .NET APIs
- ✅ React Query hooks with full type safety
- ✅ Auto-generated package.json and tsconfig.json
- ✅ Route parameter handling with ASP.NET Core constraints
- ✅ Zero TypeScript compilation errors in generated code
- ✅ 60+ C# to TypeScript type mappings
- ✅ Zod validation schema generation
- ✅ CLI tool with init, generate, and watch commands
- ✅ MSBuild integration for automatic generation
Key Improvements:
- Fixed route parameter extraction for {id:guid}, {roleId:int}, etc.
- Fixed parameter order: route params before body params
- Fixed nested generic types (Result<T>) with proper closing brackets
- Fixed namespace pollution in discovered types
- Fixed hook generation for DELETE, PUT, PATCH, POST endpoints
- Added comprehensive .NET type mappings (Nullable, IReadOnlyList, Dictionary, etc.)
See CHANGELOG.md for complete details.