Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

(Case 1096419) [asmdef] Failed to reference Assembly-CSharp.dll

Discussion in '2018.3 Beta' started by optimise, Oct 31, 2018.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    The weird thing is everything is working properly in Unity beta 7 until I reopen project again in Unity beta 7. I use Create Editmode Test Assembly Folder from Test Runner to create a folder with assembly definition file. But it seems like it cannot reference Assembly-CSharp.dll properly and failed to get Heart class.
    Note: It's the same project for Case 1096413 but with Unity beta 7.

    Open the project u will see "error CS0246: The type or namespace name 'Heart' could not be found (are you missing a using directive or an assembly reference?)". In this beta 8, it gives extra new error "GetAnalyzersFromCompilation threw an exception: System.ArgumentNullException: Value cannot be null."

    Assets\Tests\HeartTests.cs(15,22): error CS0246: The type or namespace name 'Heart' could not be found (are you missing a using directive or an assembly reference?)

    Assets\Tests\HeartTests.cs(9,13): error CS0246: The type or namespace name 'Heart' could not be found (are you missing a using directive or an assembly reference?)

    (0,0): [10/31/2018 01:40:00.039 PM] GetAnalyzersFromCompilation threw an exception: System.ArgumentNullException: Value cannot be null.
    Parameter name: source
    at System.Linq.Enumerable.Where[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x0000d] in <1b13ba6391c74847bbc3eddc86df7eee>:0
    at UnityEditor.Compilation.CodeAnalysisManager.GetAnalyzersFromCompilation (System.String assemblyFilename, System.String[] unityCompilerArguments) [0x0003f] in <b6235404321846dd874d88447d55cf5a>:0
    System.Threading.ThreadHelper:ThreadStart()
     
  2. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    asmdefs should not be able to reference Assembly-CSharp.dll (that's because Assembly-CSharp.dll implicitly references everything, and cyclic references are disallowed). if it did, it's a bug

    the internal ArgumentNullException may be another bug or related