How to remove unused methods in C#?

This question already has an answer here:

  • Can a .NET windows application be compressed into a single .exe? 12 answers

  • What you are describing is a static library, not a DLL.

    If C were a static library, then when you compile A (with the compiler set to drop unused stuff), A's exe will have all code required by A taken from the static library C and put directly into the exe. The same would go for B.

    But that's not how DLLs work.

    With a DLL, A is getting the "services" of some code from C, but since the code lives in C, A has no control over what code is in C.

    As @RobertMoskal points out, there are answers out there with tools that do what you want. I just wanted to clarify that your intent is counter to the design of Dlls although it can be done with the tools mentioned elsewhere.

    链接地址: http://www.djcxy.com/p/44500.html

    上一篇: 在java中用System.loadLibrary()加载的.dll的搜索路径是什么?

    下一篇: 如何在C#中删除未使用的方法?