我有一个带有一些条件构建的项目。我编译它。然后用dotpeek看了一下。我注意到所有条件语句和它包装的代码,即使没有定义。
由于此应用程序针对不同的客户端以某些关键方式进行了修改,因此我希望该客户端的构建具有仅包含已定义的活动 #ifs 的二进制文件。
我怎样才能实现这一目标的自动化构建?
我有一个带有一些条件构建的项目。我编译它。然后用dotpeek看了一下。我注意到所有条件语句和它包装的代码,即使没有定义。
由于此应用程序针对不同的客户端以某些关键方式进行了修改,因此我希望该客户端的构建具有仅包含已定义的活动 #ifs 的二进制文件。
我怎样才能实现这一目标的自动化构建?
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.