Skip to content

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

Open
adecler wants to merge 3 commits intodevelopfrom
RAM_Toolkit-#251=ProjectFormatUpgrade
Open

Upgrade project files to SDK-style format compatible with dotnet#252
adecler wants to merge 3 commits intodevelopfrom
RAM_Toolkit-#251=ProjectFormatUpgrade

Conversation

@adecler
Copy link
Copy Markdown
Member

@adecler adecler commented Feb 17, 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.
  • Finally, I have fixed compilation errors due to missing explicit casting for objects returned by GetDispInterfacePointerByEnum.

Tests

  • Make sure the solution build with dotnet build
  • Run your end of milestone testing procedure

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 self-assigned this Feb 17, 2026
@adecler
Copy link
Copy Markdown
Member Author

adecler commented Feb 17, 2026

@BHoMBot check compliance

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci bot commented Feb 17, 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 17, 2026

@BHoMBot check project-compliance
@BHoMBot check code-compliance
@BHoMBot check copyright-compliance
@BHoMBot check documentation-compliance

@bhombot-ci
Copy link
Copy Markdown

bhombot-ci bot commented Feb 17, 2026

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

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

@adecler adecler added the type:compliance Non-conforming to code guidelines label Mar 12, 2026
Copy link
Copy Markdown
Member

@enarhi enarhi left a comment

Choose a reason for hiding this comment

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

Unfortunately the adapter appears to be failing after building with the updated code. The error I receive is:

1. This component failed to run properly.
- Error: Could not load file or assembly 'Interop.RAMDATAACCESSLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
- Occured in  BH.Adapter.RAM.RAMAdapter..ctor(String filePath, Boolean active)
     called from BH.UI.Base.Caller.Run(List`1 inputs)
- Are you sure you have the correct type of inputs? Check their description for more details.

I confirmed that building from develop with the same environment I do not receive this error, so it appears specific to the dotnet upgrades.

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.

Upgrade project files to SDK-style format compatible with dotnet

2 participants