You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refer to an assembly A.dll that depends on B.dll but do not refer to B.dll itself. In my context, I am writing a game mod that patch the game so B.dll is loaded by the game and is not needed for my project.
Use nameof(A.SomeClass.SomeMethod). For some reason, even though this specific method signature and the method implementation do not use anything from B.dll, the following error is reported:
The type 'TickableComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'Timberborn.TickSystem, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Diagnostic Id:
N/A
Expected Behavior:
nameof should not raise any error here.
Actual Behavior:
CS0012 is reported.
The text was updated successfully, but these errors were encountered:
Refer to an assembly A.dll that depends on B.dll but do not refer to B.dll itself.
In this case the you've given the compiler an incomplete reference graph. While the compiler takes care to not dig into missing references if possible, there are no guarantees around this. The compiler has, and will in the future, introduce bug fixes that require us to dig into missing assembly references and issue an error when they are not available. The behavior of this space is overall not defined: there are cases it will work but that should be considered the exception not the rule. The compiler at is core requires a complete reference graph.
Version Used: 17.12.12.57101
Steps to Reproduce:
nameof(A.SomeClass.SomeMethod)
. For some reason, even though this specific method signature and the method implementation do not use anything fromB.dll
, the following error is reported:Diagnostic Id:
N/A
Expected Behavior:
nameof
should not raise any error here.Actual Behavior:
CS0012 is reported.
The text was updated successfully, but these errors were encountered: