I create a tool in managed code (mainly C ++ / CLI) in two versions, the "regular user" version and the "pro" version.
The fact that the base code is identical between the two versions caused me a little problem, because I want to pack the resulting tool as a single assembly (DLL), and I do not want to include .cpp files for common code in projects of two versions of the tools. I would prefer to have a project for common code and a project for each version of the tool, and each version of the tool project depends on the common code and links it as desired.
In unmanaged C ++, I would do this by posting common code in a static library and linking both versions of this tool with it. I can't seem to get this to work in C ++ / CLI. It seems that I am forced to create common code in the assembly of the DLL, and this leads to more DLLs than I would like.
So, in general, I cannot decide how to create common code in one project and associate it with each of the projects of the final product in order to create two separate DLL assemblies that include common code.
I'm probably doing something wrong, but I was trying to figure out how to do it using netmodules and all that, and I just couldn't get it to work. After all, the only way I worked was to tell the linker to link the assembly products to a common code assembly, not the results that work, but hack IMHO a bit.
Anyway, does anyone have any suggestions on how I SHOULD solve this problem?
Edited: I guess I should have mentioned that the generated assemblies are not 100% managed code, they contain a combination of managed and unmanaged code, as this is probably quite common in assemblies with C ++ / CLI ...
source
share