Reputation: 721
I have a project with a few conditional builds. I compiled it. And then used dotpeek to look at it. I noticed ALL conditional statements and the code that it wraps even when not defined.
Since this app is modified in some key ways for different clients, I would like a build for that client have a binary that ONLY contains the active #ifs that have been defined.
How can I do an automated build that achieves this?
Upvotes: 1
Views: 384
Reputation: 59303
dotPeek does 2 things
You can see this in the context menu. One entry is "Decompiled sources" and the other is "Sources from symbol files":
By double clicking an item, it will first try to perform action 2, which is: show the source file that exists on your hard disk.
Here you see a very simple program:
As you can see, the compiled code only contains those parts which it was compiled for.
Therefore, there's no need to strip those parts in a build script, because the DLL or EXE does not contain it.
Upvotes: 3