C # Lots of product skins

I am building a modular project and am looking for the best way so that we can create multiple skews of this product for different clients. This needs to be done inside the build process to prevent the client from changing the value in the config file to enable the module.

My best guess is some kind of set of environment variables associated with a particular assembly. Any advice?

+2


source to share


2 answers


Are the modules separate dlls? The two approaches I can think of are the following:



  • Use conditional compilation instructions where you include set modules, create multiple configurations that will set the correct variable values ​​(e.g. Release_A, Release_B, etc.). It can be tricky if the modules are in separate DLLs, I'm not sure how the references will be handled.
  • Write a simple plugin architecture to load modules dynamically based on a config file. This only works if the modules are in separate DLLs - you only ship the client DLLs that you paid for, so they can't really activate anything useful through the config file.
+3


source


Conditional compilation is one option.

<shameless plugin>

I wrote a short article on conditional compilation with some samples.



</ shameless plugin>

I won't describe it again, Grzenio gives a good summary, check his answer.

+1


source







All Articles