Skip to content

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

Merged
michaelhoehn merged 4 commits intodevelopfrom
Excel_UI-#427-UpgradeProjectFormat
Mar 12, 2026
Merged

Upgrade project files to SDK-style format compatible with dotnet#428
michaelhoehn merged 4 commits intodevelopfrom
Excel_UI-#427-UpgradeProjectFormat

Conversation

@adecler
Copy link
Copy Markdown
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
Copy Markdown
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Member Author

adecler commented Feb 24, 2026

@BHoMBot check installer

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci bot commented Feb 24, 2026

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

  • check installer

@adecler
Copy link
Copy Markdown
Member Author

adecler commented Feb 24, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link
Copy Markdown

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
Copy Markdown
Member Author

adecler commented Feb 24, 2026

@BHoMBot check installer

@bhombot-ci
Copy link
Copy Markdown

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
Copy link
Copy Markdown
Contributor

@michaelhoehn michaelhoehn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested and approve these changes. Functions as expected.

@michaelhoehn
Copy link
Copy Markdown
Contributor

@BHoMBot check ready-to-merge

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci bot commented Mar 12, 2026

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

  • check ready-to-merge

@michaelhoehn michaelhoehn merged commit 83bd4e1 into develop Mar 12, 2026
12 checks passed
@michaelhoehn michaelhoehn deleted the Excel_UI-#427-UpgradeProjectFormat branch March 12, 2026 22:19
@BHoMBot BHoMBot mentioned this pull request Mar 23, 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.

2 participants