[C# Project] Building Project on Build-Server

Hi all,

I am building an app that uses BricscadApp and BricscadDb. This app (C#) should be running on V21, V22, V23, etc.

On the local machine with several installation of BricsCad it works well with '' depending on the BricsCAD version, I choose to compile.
So far so good.

Now I try to integrate this project on our Build-Server, so the Build-Server could build the app in different versions every night.

The Problem: I could not install different Version of BricsCAD on this Build-Server. So, the 'COMReference' will not work.

Has anyone a “best practice” for a solution?
Maybe using 'COMFileReference' instead of 'COMReference' is an option, but I have never used it.

Any solution is welcome! Thank you very much!

Volker

Comments

  • Not sure how heavily you rely on COM, but you can avoid adding references by using C#’s Dynamic keyword.
    Example https://www.theswamp.org/index.php?topic=55916


  • Hello Nigel,
    Thank you very much for your response. Your solution seems really impressive. But I do not think would work for me.
    The “only” problem is the step ‘Build-Server’ in the workflow. The app is part of a bigger solution, and it is mandatory, to have an own DLL for every BricsCAD Version.
    Volker
  • Haven’t tried, but you may be able to use Tlbimp.exe, to generate assemblies for each version. Then reference those on your build server.
  • Thanks a lot for your suggestions.
    I tried to work with Tlbimp.exe and in another experiment with 'COMFileReference' instead of 'COMReference'.
    In both cases, the build server created the C# project for each desired version.
    Unfortunately, the builds created this way do not let me run them with "_NETLOAD".
    I get the messages like "Error: The file or assembly "Interop.BricscadApp, Version=22.0.0.0, Culture=neutral, PublicKeyToken=null" or a dependency on it was not found. The system cannot find the specified file."
  • Its_Alive
    edited January 2023
    when you reference the dlls created from Tlbimp.exe, try setting [embed interop types] to false.
    you'll need to package those dlls in the same folder as your main assembly.

    If that doesn't work, your only choice is to install bricscad on your build server.

    edit: or you had [embed interop types] = false and you didn't include the dlls in your package
    in this case set [embed interop types] = true.
  • Yes, I've tried that, but I'm not sure how much that will cause problems in the DLL dependencies later on. Just in case there is a new intermediate version.

    I'm afraid I will have to resort to the solution of installing BricsCAD on the server.

    Thanks a lot!
  • CSLIDs don’t change within intermediate versions, so your safe there.
    ..
    If you have a server, you can setup virtual machines, one for each version of BricsCAD, and now you can use the build server for automated tests : )

    Best of luck :)
    !dan
  • Hallo Nigel,

    That would mean "shooting with cannons at sparrows" as we say in Germany (I don't know the appropriate counterpart in English) for 2 DLLs per version.

    But thanks for your suggestions, I see clearer now, and I learned something too.

    Thank you very much!
    Volker