1

I have a VS project A and test project for A called TA

so A (unsigned ) referenced some signed assembly moduleB, in my understanding since TA is already reference A's assembly, I don't need to explicitly reference moduleB. but if I don't do that the compiler complains:

Error 5 The type 'module B' is defined in an assembly that is not referenced. You must add a reference to assembly 'module B, Version=9, Culture=neutral, PublicKeyToken=x'

zinking
  • 5,561
  • 5
  • 49
  • 81

1 Answers1

0

You will only get these at compile time if you're using an object that gets methods/properties/members etc from assembly B

This is because .NET cannot rely on assembly A to ensure it will be able to obtain proper symbol and meta data information.

Answer Source

Community
  • 1
  • 1
Kurubaran
  • 8,696
  • 5
  • 43
  • 65
  • @zinking But members of A might be accessing B, In that case compiler will expect TA to have reference to B as well.\ – Kurubaran Dec 06 '13 at 06:40
  • I haven't used any method that relates with B, but A do have some method taht return a class that is defined in B which I haven't used at all. is that to say even under this case, I still have to import the B assembly because A exposed public interfaces that dependent on B ? – zinking Dec 06 '13 at 06:43
  • that is the case, understood. – zinking Dec 06 '13 at 06:44