Search Unity

Bug Create assembly definition for scripts breaks project (are you missing an assembly reference error)

Discussion in 'Editor & General Support' started by lstewart99, Sep 23, 2022.

  1. lstewart99

    lstewart99

    Joined:
    Mar 19, 2022
    Posts:
    2
    Hi, I am trying to create unit tests for my project however when I create an assembly definition file in my scripts folder (so that I can access them in my test scripts) I get 74 occurrences of the following error where 'TMPro something different for each one:

    ' error CS0246: The type or namespace name 'TMPro' could not be found (are you missing a using directive or an assembly reference?)

    Unity version: 2020.3.35f1
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,929
  3. lstewart99

    lstewart99

    Joined:
    Mar 19, 2022
    Posts:
    2
    Even if I don't try and link it i.e. if I just put an assembly definition in my Scripts folder (all the scripts within this folder are my own) then I get the error mentioned
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    7,929
    Way to not read or understand my response at all, nor read the docs.

    Your error is saying you code uses TMPro, but your assembly doesn't have a reference to the TMPro assembly. Go to your new assembly, and add the TMPro assembly to its list of references.

    I can't put it any more plainly than that.
     
  5. h4aku

    h4aku

    Joined:
    Nov 27, 2023
    Posts:
    1
    Man you are a life saver!