XbimGeometry icon indicating copy to clipboard operation
XbimGeometry copied to clipboard

Failed to load Xbim.Geometry.Engine64.dll

Open GVladislavG opened this issue 4 years ago • 7 comments

Some of my colleagues can't run my xBim Application with this log:

Failed to load Xbim.Geometry.Engine64.dll в Xbim.Geometry.Engine.Interop.XbimGeometryEngine..ctor(ILogger`1 logger) в Xbim.ModelGeometry.Scene.Xbim3DModelContext.get_Engine() в Xbim.ModelGeometry.Scene.Xbim3DModelContext.CreateContext(ReportProgressDelegate progDelegate, Boolean adjustWcs)

But some of them have no problem and everything works well. What's the reason of this truble?

I put these files to application folder: Files

GVladislavG avatar Feb 11 '21 13:02 GVladislavG

You need to check your deployment routines.

martin1cerny avatar Feb 11 '21 16:02 martin1cerny

And what deployment routines do I need? I just give them this files. There's no any installer or deployment process for my xBim application. Do I need to register xBim dll's on computers of my colleagues?

GVladislavG avatar Feb 11 '21 18:02 GVladislavG

They probably don't have the right version of Microsoft Visual C++ Redistributable package in their system. This usually comes with updates, but you are better to check.

martin1cerny avatar Feb 12 '21 09:02 martin1cerny

This is usually one of a several issues, all of which have solutions in the Issues in this repo:

  1. Missing VC runtime that the Geometry Engine depends on. Installing the latest Windows 10 SDK should do the trick, or else see https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0
  2. Using incompatible dependencies. e.g. a v5 Geometry with a v4 Essentials, or vice versa - we broke some interfaces between versions
  3. Bringing in an incompatible version of Microsoft.Extensions.Logging transitively from some 3rd party dependency. i.e. we use M.E.L 2.1.1 but that's not compatible with 1.x versions (e.g. older Revit has this issue)
  4. The native geometry engine is not being copied into bin, or it's the wrong platform. E.g. 32 bit apps should have Xbim.Geometry.Engine32.dll while 64bit apps should have Xbim.Geometry.Engine64.dll. If you build for MSIL what you deploy depends on if your OS is 32 bit or 64bit...
  5. ASP.NET (Core) Web apps have issues when both 64bit and 32 bit Geometry Engines are present in the bin folder resulting in a BadImageFormatException

In your case it looks like one of 1-4 might be the issue. Hard to tell without the exception.

andyward avatar Feb 12 '21 13:02 andyward

Hi i encountered the same error my versions are: Essentials 5.1.323 Geometry 5.1.403 through analyzing the debug output I found that the Engine64.dll file was taken from the GAC deleted the GAC everything works correctly

hope it helps

theextremeandy avatar Mar 19 '21 10:03 theextremeandy

That's a good call. It's pretty hard to justify using the GAC these days.

andyward avatar Mar 19 '21 12:03 andyward

I found that this issue was caused by windows feature- auto blocking the dlls and exes downloaded from network. I ticked the unblock checkbox in properties of Xbim.Geometry.Engine64.dll and it worked. This unblock feature or bug seems to block only references of references as this dll is referenced by Xbim.Geometry.Engine.Interop.dll . image

prasuncct avatar May 07 '21 11:05 prasuncct