joniles / mpxj

Primary repository for MPXJ library
http://www.mpxj.org/
GNU Lesser General Public License v2.1
249 stars 104 forks source link

Cross-building of .NET MPXJ dependency... #773

Closed NicoMackLIST closed 1 week ago

NicoMackLIST commented 1 week ago

I'm using the .NET package (MPXJ.Net v13.6.0) of the MPXJ library to import MPP files. Its my understanding that, when the NuGet package is added the first time, the .NET assembly is locally build the next time the application is build. The problem I'm facing now is the following. I got a new Macintosh as my workstation with an Apple Silicon M3 processor. Since I have that machine, I have to cross-build my docker images from arm64 to amd64. Now, the application I'm building runs fine on AMD64 based virtual machines. However, whenever I'm calling the MPXJ library it seems the application crashes and just restarts. So I'm suspecting that the .NET assembly is not being rebuild during the docker cross-build process. Is there a way to enforce a rebuild during the docker build process?

Kind Regards

joniles commented 1 week ago

Hello! Thanks for opening the issue. As far as I can tell when you build your project with MPXJ.Net as a dependency, everything you need for all supported platforms is available in the bin directory, so you shouldn't need to do anything special to get the code running under a different architecture. Have a look at the contents of the ikvm and runtimes folders in the bin directory of your project and you'll find the native code for the supported platforms.

whenever I'm calling the MPXJ library it seems the application crashes

I recently dealt with an issue which sounds similar (https://github.com/joniles/MPXJ.Net/issues/14) in this case the problem was a missing library in the container image. Might be worth trying the solution I wrote up on that issue to see if it has any effect?

If that doesn't solve the problem, can you provide a stack trace, or anything which might shed light on where the application is crashing?

NicoMackLIST commented 1 week ago

Hi Joniles, Thanks for the quick feedback and the link to the similar issue. In fact I had exactly the same issue with the same library being missing. I added the library to the final build and now everything is running fine. Thanks again for your swift help. Much appreciated.