Skip to content

Upgrade project files to SDK-style format compatible with dotnet#428

Open
adecler wants to merge 4 commits intodevelopfrom
Excel_UI-#427-UpgradeProjectFormat
Open

Upgrade project files to SDK-style format compatible with dotnet#428
adecler wants to merge 4 commits intodevelopfrom
Excel_UI-#427-UpgradeProjectFormat

Conversation

@adecler
Copy link
Member

@adecler adecler commented Feb 24, 2026

Issues addressed by this PR

Fixes #251

  • The project files were still using the legacy .NET Framework project files and needed to be upgraded to SDK-style format compatible with dotnet.
  • I have not upgraded the framework to netstandard2.0 as I was not confident this would be compatible for this repo and its dependencies.
  • I had to upgrade some nuget package references for the project to compile correctly
  • Fix the projects to make sure the compilation output is written directly in the Build folder (not in Build\net472).
  • Finally, I have fixed compilation errors due to missing explicit casting of Excel objects.

You can find more details on the logic behind the modifications done in this PR here:
SDK_Migration_Notes.md

Tests

  • Make sure the solution build with dotnet build

  • Run your end of milestone testing procedure

  • There is also an installer for this PR available on SharePoint at BHoM\Excel_UI\#428-UpgradeProjectFormat. You can use it to test this PR but still make sure that dotnet build runs successfully.

Note on the need for explicit casting

The old .csproj explicitly set EmbedInteropTypes=True on the interop reference (confirmed in git). With the old project format (non-SDK, packages.config), the .NET Framework build toolchain's NoPIA (No Primary Interop Assembly) embedding mechanism was more permissive — it allowed implicit assignment from object to a COM interface type that was simultaneously being embedded into the consuming assembly, treating it as type-equivalent at the point of use. The compiler silently inserted the conversion.
The new SDK-style project format uses a stricter Roslyn integration. Even when EmbedInteropTypes=True is active (the default for Interop.* packages), it no longer permits that implicit object → specific COM interface coercion. It requires the cast to be written explicitly.

@adecler adecler requested a review from michaelhoehn February 24, 2026 10:37
@adecler adecler self-assigned this Feb 24, 2026
@adecler adecler added the type:compliance Non-conforming to code guidelines label Feb 24, 2026
@adecler
Copy link
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@adecler to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@adecler
Copy link
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@adecler to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@adecler
Copy link
Member Author

adecler commented Feb 24, 2026

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@adecler to confirm, the following actions are now queued:

  • check installer

@adecler
Copy link
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@adecler to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@adecler
Copy link
Member Author

adecler commented Feb 24, 2026

@BHoMBot check installer

@bhombot-ci
Copy link

bhombot-ci bot commented Feb 24, 2026

@adecler to confirm, the following actions are now queued:

  • check installer

@adecler adecler changed the title Excel UI #427 upgrade project format Upgrade project files to SDK-style format compatible with dotnet Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:compliance Non-conforming to code guidelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant