microsoft / microsoft/vscode-mssql

[Bug]: Schema Compare failed: 'Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'.'

Open
#22,858 0 comments 0 reactions 1 assignee View on GitHub

@aasimkhan30 is already working on this.

Since Sep 3, 2026.

Bug Triage: Needed User-filed
Dominant language
TypeScript
Stars
1.9k
Forks
610
Avg merge
2d 3h
Merged PRs (30d)
97

Description

Description

Summary

Schema Compare consistently fails when a Microsoft Fabric Data Warehouse is used as either the source or the target of the comparison.

The connection to the Fabric Warehouse succeeds and metadata loading starts correctly, but the comparison fails during target model population with the following exception:

Schema Compare failed: 'Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type `'System.Int32'.'``

The issue occurs regardless of comparison direction:

  • SQL Database Project -> Fabric Data Warehouse
  • Fabric Data Warehouse -> SQL Database Project

Expected Behavior

Schema Compare should successfully load the Fabric Data Warehouse schema model and display schema differences.

Actual Behavior Schema

Compare fails before the comparison results are displayed. Error message:

Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'.

Additional Observation

The Fabric Warehouse connection is successfully established before the failure occurs.

Relevant log entries:

[ConnectionManager] Connected to server "...datawarehouse.fabric.microsoft.com" Server information: { "serverVersion":"12.0.2000.8", "engineEditionId":11, "serverEdition":"Azure SQL Analytics on-demand", "isCloud":true }

[schemaCompare] Starting schema comparison

[schemaCompare] Executing schema comparison

[schemaCompare] Schema comparison failed: Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'.

The failure occurs approximately 15-20 seconds after the schema comparison starts.

Steps to Reproduce

  1. Open Visual Studio Code.
  2. Open the MSSQL extension Schema Compare experience.
  3. Configure a comparison between a SQL Database Project and a Microsoft Fabric Data Warehouse.
  4. Start the comparison.
  5. Wait for schema loading to complete.

Result:

Schema Compare failed: Unexpected exception caught during population of target model: Unable to cast object of type 'System.Boolean' to type 'System.Int32'.

The same error is observed when reversing the comparison direction and using the Fabric Data Warehouse as the source.

PossibleCause

The exception suggests that one of the metadata properties returned by the Fabric Data Warehouse provider is exposed as a Boolean value while the Schema Compare engine expects an Int32 value during model population.

Since the connection succeeds and the failure occurs while loading the target model, the issue appears to be related to metadata interpretation rather than connectivity or authentication.

The issue appears reproducible on every execution and is not related to connection establishment. The connection succeeds and metadata retrieval starts before the model population phase fails.

Steps to Reproduce
  1. Open Visual Studio Code.
  2. Open the MSSQL extension Schema Compare experience.
  3. Configure a comparison between a SQL Database Project and a Microsoft Fabric Data Warehouse.
  4. Start the comparison.
  5. Wait for schema loading to complete.
Affected Area
  • Connection dialog (SQL Server | Azure browse/Fabric browse)
  • Query editor
  • Query results panel
  • Object Explorer
  • GitHub Copilot integration
  • Preview/Edit data
  • Table Designer
  • Schema Designer
  • Schema Compare
  • Local SQL Server Container provisioning
  • SQL database in Fabric provisioning
  • DACPAC/BACPAC export/import
  • SQL Database projects
  • Query Plan Visualizer
  • Other (please describe below)
If you selected "Other", please describe the affected area

No response

Environment Information

VS Code Version : 1.135.0 User Setup
MSSQL : 1.45.1
OS : Windows 11
SQL Database Projects version : 1.7.0
Target Platform: Microsoft Fabric Data Warehouse
Authentication: Microsoft Entra ID (MFA)
Server Version: 12.0.2000.8
Server Edition: Azure SQL Analytics on-demand

Confirmation
  • I have searched existing issues and couldn't find a match
  • I want to work on this issue

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.