I have a legacy project that uses a OCX. I had to register said OCX on my system using regsvr32.
Now, I want for Jenkins to compile the project. Unfortunately, in the Jenkins Server there is no OCX and I don't want to register it.
Is there a way to distribute the OCX so the project can compile on Jenkins? I read about registration-free components, but there seems to target runtime requeriments, and my issues are at compile time.
Yes - the way to do it is as Reza Aghaei says.
Call tlbimp to generate an interop assembly (it doesn't have to be a primary interop assembly). Then instead of referencing the ocx in the project, you reference the interop dll.
Note that if you want to run the project or use the control in the winforms designer you'll still need to register the ocx. Build for Building from Jenkins, this will work fine we use this technique to build our legacy code.