If i reference unused assembly using the /r flag in the command prompt the csc will ignore it.

so what if i reference unused assemblies via the IDE will it show the same behavior ?

and what if i am using other c# compilers other than Microsoft's csc ?

有帮助吗?

解决方案

Mono's mcs compiler will not include references unless they're actually used in your app.

And even if they were, the referenced assemblies would only be loaded when used in your app. But since they're not, they'd just waste a few bytes in the assembly.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top