Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

(Visual studio) Editor scripts cannot find script outside of editor folder

Discussion in 'Editor & General Support' started by Dawdlebird, May 6, 2020.

  1. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Heya, I have a bunch of Editor scripts (property drawers and custom editors and such) that refer to classes they create interfaces for. This always worked fine, but recently (probably due to an upgrade in Unity and Visual studio, all my Editor scripts give me missing namespace/assembly errors. Things still work fine in Unity, but obviously I can no longer work on these Editor scripts with references missing... Anyone knows a straightforward solution to this?
     
  2. DiegoDePalacio

    DiegoDePalacio

    Unity Technologies

    Joined:
    Oct 28, 2009
    Posts:
    506
    Hello @stuffkikker,

    In order to be able to help, you need to provide more information.

    Can you share your error messages specific text/content?

    Thanks!
     
  3. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    Hey Diego, thanks for the response. To be clear; there are no errors in Unity. Perhaps this is not the place to ask, but I didn't know where else. The problem is in Visual Studio; Scripts in the "Editor" folder (for property drawers and custom editors and such) get put in a different 'project' than the non-editor scripts.
    upload_2020-5-7_8-56-44.png
    I'm pretty sure this was always the case, but before this was never an issue. Recently however, scripts in the Editor folder cannot find the classes I am writing editor scripts for.
    As an example, I have a 'LocalizedTextEditorWindow' for editing text data, which takes a class 'LocalizationData'.
    upload_2020-5-7_8-58-5.png
    But like all scripts outside of the Editor folder, such classes are now considered missing :\
    I've tried uninstalling Unity and Visual Studio in case this was some odd fluke, but the issue persists.
    Apologies if this is not the right forum for this type of question, but I'm a bit at a loss here.
     
  4. Dawdlebird

    Dawdlebird

    Joined:
    Apr 22, 2013
    Posts:
    85
    After several uninstalls/re-installs of both Unity and Visual Studio, I just updated to 2019.2.13f1 (which was released today I think) and the problem seems to be gone! Nothing of it is mentioned in the changelog, but I'm guessing something got fixed.
     
  5. Awarisu

    Awarisu

    Joined:
    May 6, 2019
    Posts:
    215
    For future readers you can try closing both Unity and VS, deleting all the .csproj and .sln files at the top level of your project, then opening a .cs script from Unity again so it can recreate them.
     
  6. Hobby-Game-Developer

    Hobby-Game-Developer

    Joined:
    Aug 27, 2017
    Posts:
    14
    Nope, that didn't do anything (for anyone interested)! But thanks.
     
    Mi-Jeremy likes this.