views:

31

answers:

1

Microsoft .NET Framework

Assembly A

Assembly B
    Contains Class C - References Assembly A
    Contains Class D - Does not reference Assembly A, Does not reference Class C

Questions: During runtime if Assembly A DLL does not exist, will Class D be able to execute successfully? Where as Class C will fail with a reference error?

A: 

You are correct.

If you do not deploy Assembly A with Assembly B and the running code does not call any members of Assembly A, then you will not get a runtime error.

In the same case, if you are calling members of Assembly A, then you will get a missing reference exception.

Oded
I thought you would get a compile error on the whole application...?
Tommy
@Tommy - he is talking about _runtime_. Compile the application, but only distribute one assembly.
Oded
Rgr - misunderstood the question. Why would someone want to do that again?
Tommy
@Oded - Yes, I am talking about run time. It's a long story of the why... As far as I can tell in my testing so far, I am seeing the same results. Thanks for the info.
M3NTA7