System.IO.FileLoadException: Failed to load Xbim.Geometry.Engine32.dll
So I am running a program that is loading IFC files and using XBIM Geometry. However, when I load an IFC file and use Xbim3DModelContext, the code breaks and gives an error. (attached in expected outcome section).
Things tried:
My bin folder has both files: Xbim.Geometry.Engine32.dll and Xbim.Geometry.Engine64.dll I have tried deleting 32.dll version but it recreates with every build. I have built the solution with x64 configuration instead of any CPU but it didn't help. I have upgraded/downgraded to specific XBIM versions specially packages Xbim.Geometry.Engine.Interop & Xbim.ModelGeometry.Scene but it didn't hep either.
Steps (or code) to reproduce the issue:
In the debug mode, the code that gives rise to the error is following:
IfcStore model = IfcStore.Open(fileName); // loadin ifc file Xbim3DModelContext context = new Xbim3DModelContext(model); context.CreateContext(); var instances = context.ShapeInstances();

Minimal file to reproduce the issue:
Expected behavior:
What would you expect to happen
Actual behavior or exception details:
However, when I run, it gives this error:
System.IO.FileLoadException: Failed to load Xbim.Geometry.Engine32.dll ---> System.IO.FileLoadException: Could not load file or assembly 'Xbim.Geometry.Engine.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'Xbim.Geometry.Engine.dll' ---> System.IO.FileLoadException: Could not load file or assembly 'file:///D:\HiWi_AI\neighbourhood_features\neighbourhood_features\Test\bin\Debug\Xbim.Geometry.Engine32.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)

Additional Details
I am using Visual Studio 2021, .net4.8 version, 64 bit engine.
Following are the XBIM versions and other dependencies attached.

This has been asked lots of times before. There can be various reasons: see https://github.com/xBimTeam/XbimGeometry/issues/312#issuecomment-778184952 for some possible solutions