Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please help to could not load file or assembly Xbim.Geometry.Engine64 or one of its dependencies #215

Closed
castronelson opened this issue Sep 10, 2019 · 31 comments

Comments

@castronelson
Copy link

Expected behavior:

Actual behavior or exception details:

Version of the xBIM Viewer:

Minimal code (or steps) to reproduce the issue:

var viewer = new Viewer(canvas);
(...)

Minimal file to reproduce the issue:

(IFC files need to be zipped to be uploaded. Than just drag & drop here)

@castronelson
Copy link
Author

we have the following coding for converting IFC file to WEXBIM

Error showing below line
context.CreateContext();
"Could not load file or assembly Xbim.Geometry.Engine64.dll or one of its dependencies"

Code:
var IfcTestFile = filePath;
//using (var model = IfcStore.Open(Server.MapPath(@"SampleHouse.ifc")))
using (var model = IfcStore.Open(IfcTestFile))
{
var context = new Xbim3DModelContext(model);
context.CreateContext(); //Error getting here

            var wexBimFilename = Path.ChangeExtension(IfcTestFile, "wexbim");
            using (var wexBiMfile = File.Create(wexBimFilename))
            {
                using (var wexBimBinaryWriter = new BinaryWriter(wexBiMfile))
                {
                    model.SaveAsWexBim(wexBimBinaryWriter);
                    wexBimBinaryWriter.Close();
                }
                wexBiMfile.Close();
            }
        }

we need 64 bit dll because while running through IIS its should works fine

@martin1cerny martin1cerny transferred this issue from xBimTeam/XbimWebUI Sep 10, 2019
@andyward
Copy link
Member

Make sure the Xbim.Geometry.Engine64.dll DLL is being copied into your websites's bin[Config] folder.

@castronelson
Copy link
Author

castronelson commented Sep 11, 2019 via email

@castronelson
Copy link
Author

castronelson commented Sep 11, 2019 via email

@martin1cerny
Copy link
Member

Please, refer to issues already resolved:
#153 #159 #189 #193 #195

@castronelson
Copy link
Author

castronelson commented Sep 11, 2019 via email

@martin1cerny
Copy link
Member

Please, use the package manager to keep the right version dependencies of all packages and dlls.

@martin1cerny
Copy link
Member

This is a duplicate of xBimTeam/XbimWebUI#244

@castronelson
Copy link
Author

castronelson commented Sep 12, 2019 via email

@martin1cerny
Copy link
Member

@castronelson
Copy link
Author

castronelson commented Sep 12, 2019 via email

@castronelson
Copy link
Author

castronelson commented Sep 12, 2019 via email

@castronelson
Copy link
Author

castronelson commented Sep 12, 2019 via email

@castronelson
Copy link
Author

castronelson commented Sep 12, 2019 via email

@andyward
Copy link
Member

HI @castronelson

Sorry, it's really hard to follow all these emails chains in Github. Can we ask you to use the Github interface for replies so we can:

  • avoid all the email history / signatures
  • have some formatting of any code etc
  • see any screenshots (which don't make it through github's email=>Issue gateway)

If I may say, I think some of your issue may be better resolved in Stack Overflow as they sounds like basic debugging & problem-solving issues rather than a problem with XBIM Geometry.

Responding to the points

  1. http://docs.xbim.net/examples/creating-wexbim-file.html is the principal way to generate WexBIM from IFC. WexBIM is XBIM's format so you won't find other implementations
  2. Your issue with 'An attempt was made to load a program with an incorrect format.' is you're loading a 64 bit geometry DLL into a 32 bit IIS process (or vice versa). Make sure you don't have both 32bit and 64 bit in the bin folder, and make sure it's the right one for the IIS app-pool

@castronelson
Copy link
Author

i was added the 64 bit ddl in bin folder
but in visual studio it showing both dll ,we cannot be able to delete 32 bit dll ?even i deleted the 32 bit dll in package path,it showing 32 bit dll not found when build

@andyward
Copy link
Member

OK. I know what that is. Our Geometry.Engine.Interop nuget package is deploying both 32bit & 64 bit to the bin during the build.

I'll see about a proper fix in #216

If you can post-process the build you should be able to remove the un-needed DLLs.

@andyward
Copy link
Member

I've updated an sample app that should demonstrate the basics, using the latest code:

https://github.com/andyward/XbimWebDemo

I've added a small msbuild hack for the native DLLSs This won't be necessary in the long-run.

Note: as I mention in the code, I'd not really recommend doing IFC-> Geometry synchronously in a web app. It's not a robust architecture for processing large models in this way

@castronelson
Copy link
Author

we cannot be open that file after downloaded, everything is unloaded

@castronelson
Copy link
Author

ok now opened.

@castronelson
Copy link
Author

when i run this below error will create

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="XbimDemoWebApp.MvcApplication" Language="C#" %>

here not clarity on this solution :)

@castronelson
Copy link
Author

may i know that your provided link is now working solution? or
from the solution what are the steps to do make for IFC to Wexbim
if you dont mind help me regarding? using 64 bit dll to conversion (asp.net normal web form
WebApplication2.zip

)
I have attached the file with deleted xbim dll (<10mb allowed here)

@andyward
Copy link
Member

Why are you not using Nuget to get xbim binaries? It looks like you're referencing them from some local folder. I can't stress enough how much simpler it is to get the packages from nuget (or myget). We can't really help you when you manage dependencies in a way that give us no repeatable way of building your code.

You're also referencing net45. The latest 5.x version of xbim requires net47.

My example should just work. Have you got ASP.NET MVC installed? What version of Visual Studio are you using?

@castronelson
Copy link
Author

visual studio version 14.0

@castronelson
Copy link
Author

yes we have ASP.NET MVC installed.

@castronelson
Copy link
Author

sql server 2012 is required?
when running this app below error occurred
<%@ Application Codebehind="Global.asax.cs" Inherits="XbimDemoWebApp.MvcApplication" Language="C#" %>

@castronelson
Copy link
Author

The file yesterday sent to you which has the dll from another referenced project because when installed Xbim.Geometry from nuget both 32 and 64 bit dll created together,so avoid such thing i referenced from another project which is also installed directly from nuget package manager(Xbim.Geometry)

@castronelson
Copy link
Author

image

@castronelson
Copy link
Author

Hi,
Sorry for the inconvenience caused.
Currently we have followed the below steps:

  1. Download the given MVC solution.
  2. We have build the given MVC solution in Visual Studio 2017 and Framework 4.7.
  3. Build succeeded.
  4. If we run the solution we have received the below error. (but if we build the solution, it will be succeeded)
    image

We have also tried to download the Xbim.Geometry.Engine.dll from nuget packages - it shows the Xbim.Geometry.Engine.Interop was already installed.

Could you please help us to resolve this issue.

Thank you in advance.

@andyward
Copy link
Member

Can you take this over to https://github.com/andyward/XbimWebDemo/issues

@Rachvel
Copy link

Rachvel commented Aug 27, 2024

See solution in #312, you may interest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants