I've currently got a C# code base that is compiled into a library. I have two clients each requiring only a selected sub set of the methods available and management are concerned that they may share files to get access to other methods they have not paid for (paranoid).
To reduce complicating the project I've created two Setup projects that include the primary output of the code project and wish t开发者_如何学Goo supply /define arguments to the compiler on a per Setup project basis to remove certain methods.
Is this possible?
Is there a better way to approach this?
Thanks for the replies.
I don't get the "swap files" angle, swap with what? But, no, a setup project can't compile code. You'd need separate build projects or leverage #ifdef.
If it's a licensing question, I'd be tempted to suggest that you check the license with each method that's called, though this may add significant overhead.
Alternatively, you'd be better off creating two Visual Studio Projects, each containing only the sub-set that each client needs, and naming each one after the client that needs it. They can both share the same source files, but be built into two different binaries.
I'm assuming that you're shipping the library as your product, rather than shipping a product that uses the library?
精彩评论