-2

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 ?

a7madx7
  • 840
  • 1
  • 8
  • 18
  • Are you worried that the reference will still be present, or that you'll get an error? These sound like simple things to test... – Jon Skeet May 05 '13 at 07:25
  • 1
    No I am worried that reference will still be present and unused causing my application to load up unused assemblies. – a7madx7 May 05 '13 at 07:28
  • 2
    Assemblies are only loaded when they're used anyway. But again, this seems easy to test. – Jon Skeet May 05 '13 at 07:33
  • 1
    thanks for Assemblies are only loaded when they're used anyway @JonSkeet – a7madx7 May 05 '13 at 07:47

1 Answers1

2

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.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86