I have a project that must reference and call a DLL which is created by executing a 3rd party executable every time a build is triggered. (A proxy-DLL that is created from a JAR file to enable calling Java-Code from within C#. Done using proxygen
from jni4net
, but that's not important. The JAR file might change from time to time, but its calling interface stays the same).
I also need to instantiate an object from a class from the DLL and call methods on the object.
I have 2 approaches in mind:
1) Run it as a pre-build step in the same project. But this means I have to include a DLL in the repository and add that DLL as a reference to the project, so that C# knows that my calls are valid. And that means that I'll have a "stale" DLL in my repo and everytime a build is triggered, the SCM detects it as changed.
2) Create a dummy DLL project, e.g. with a dummy C# file, and then execute the program in a post-build step to overwrite the dummy DLL with the actual DLL. I could then add this as a normal project dependency. I would then have to implement dummy calls in the C# for the actual calls that are later in the "real" DLL so that the other project doesn't complain about the calls. But I wouldn't have to include a stale DLL in the repository.
Is there a better, more elegant solution?