Hoops Exchange - Visual C++ Library - Creating a linux docker image

Hello,
I want to create a c++ library that uses some features of Hoops Exchange, like importing a file and converting it to other format. This library will be consumed by a C# application (.net core application) using P/Invoke.

This application will run in a docker container that uses Linux operating system (ubuntu).

Quick question:
Can I build this c++ library on Visual Studio 2022 using my windows machine and then can I put these binaries on linux? Do I will need to download the “Microsoft Visual C++ Redistributable” on linux? Which Hoops Exchange binaries do I need to use, windows or linux? When I am creating this linux docker image, how I can compile and build this c++ library?

Details:

  1. I first started using Visual Studio 2022 to create a visual c++ project (vcxproj extension). Then I created a C# application (.net core) with a reference to this vcproj project. It works and it runs in my windows machine. But when I tried to deployed it to a linux docker container it failed. It fails when I do “dotnet build”. Linux does not support vcxproj. Because “dotnet” is cross platform, it works for .net core applications but it does not support C++/CLI.

  2. We can see in this link, Linux does not support C++/CLI, C++/CLI migration to .Net core on Linux · Issue #2508 · dotnet/core · GitHub

  3. So now I am trying using CMAKE, to build this c++ library on the docker image, using Hoops Exchange binaries.

But I am not 100% sure I am following the correct path. Is there a way I can build this c++ library on Visual Studio and them a way to create a linux docker image that can use it?

Thank you.
I wish you a merry Christmas and happy new year.
Alberto

1 Like

Hi Alberto,

I think Visual Studio can build for linux now theoretically but I doubt that this approach will work in this case, and I don’t think c# is well supported under linux. You are probably better off using a windows based docker container or writing a native linux application and skipping c# altogether.

I let one of my colleagues chime in though who have more experience in that area.

Happy New Year to you as well!
Guido

1 Like