CodeBridge.MSBuild 1.0.0-preview.7

This is a prerelease version of CodeBridge.MSBuild.
There is a newer version of this package available.
See the version list below for details.
dotnet add package CodeBridge.MSBuild --version 1.0.0-preview.7
                    
NuGet\Install-Package CodeBridge.MSBuild -Version 1.0.0-preview.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="CodeBridge.MSBuild" Version="1.0.0-preview.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="CodeBridge.MSBuild" Version="1.0.0-preview.7" />
                    
Directory.Packages.props
<PackageReference Include="CodeBridge.MSBuild">
  <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 CodeBridge.MSBuild --version 1.0.0-preview.7
                    
#r "nuget: CodeBridge.MSBuild, 1.0.0-preview.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 CodeBridge.MSBuild@1.0.0-preview.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=CodeBridge.MSBuild&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeBridge.MSBuild&version=1.0.0-preview.7&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in 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.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-preview.7: Fixed import generation and service parameter detection
           - Fixed: Import statements now properly extract individual type names from generic types
           (Result, InitiateLoginResponse, etc.)
           - Fixed: Service interfaces (ICurrentUserService, etc.) no longer treated as request
           parameters
           - Fixed: Generated functions now have correct request and response types
           - Improved: Type extraction from nested generics (ApiResponse<Result<T>>)
           - All 42 tests passing
           - Fixed: Validation calls only generated for types with validation schemas
           - Fixed: Added validation imports to generated API files
           - Fixed: Service interfaces no longer have validation calls
           - Improved: Conditional validation based on actual schema existence