M3NTA7
M3NTA7

Reputation: 1347

Run time behavior of .NET referenced assembly not existing

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?

Upvotes: 0

Views: 125

Answers (1)

Oded
Oded

Reputation: 498904

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.

Upvotes: 1

Related Questions