Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

How to add Assembly-CSharp reference to asmdef?

Discussion in 'Scripting' started by Lesha-VH, Nov 6, 2019.

  1. Lesha-VH

    Lesha-VH

    Joined:
    Jul 3, 2012
    Posts:
    87
    I can not add reference to custom asmdef, because Assembly-CSharp it no in list.

    What workaround?
    I suspect just add asmdef to each top folder that contains scripts.
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,951
    Assembly-CSharp automatically has a reference to every asmdef-based assembly, so they can't reference it.
     
  3. Lesha-VH

    Lesha-VH

    Joined:
    Jul 3, 2012
    Posts:
    87

    Attached Files:

  4. mbentley3123

    mbentley3123

    Joined:
    Jul 2, 2020
    Posts:
    1
    I don't think so.
    1) I checked, and my project creates an EditModeTests project using an asmdef file. Assembly-CSharp.csproj does not have a reference to it.
    2) Currently, I am trying to access the code in Assembly-CSharp from EditModeTests and can not seem to get it to put a reference in. So, neither project can see the other.
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,951
    You're right, assemblies marked as test assemblies can't be referenced by Assembly-CSharp. That's for obvious reasons - test assemblies are not included in builds, so your build would fail.

    So I was wrong back last November!
     
unityunity