Search Unity

Packages, Assembly definition will not be compiled, because it has no scripts associated with it

Discussion in 'Package Manager' started by Stranger-Games, Jan 1, 2021.

  1. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Hi,

    I created a custom package and I noticed that I get the error 'asmdef will not be compiled, because it has no scripts associated with it.' if I have my script in a subfolder of the folder that contains the asmdef file.

    CustomPackage
    --Editor
    ----assembly.asmdef
    ----SubFolder
    ------script.cs

    It is fixed if I have my script in the same folder as the asmdef file

    CustomPackage
    --Editor
    ----assembly.asmdef
    ----script.cs

    For large packages that would be inconvenient.
    asmdef files in the main Assets folder don't act similarly and include scripts in subfolders as it should.

    Edit:
    -----
    I am using Unity 2020.2.1f1

    Thanks for advance.
     
  2. Stranger-Games

    Stranger-Games

    Joined:
    May 10, 2014
    Posts:
    393
    Right Click-> Reimport fixed the problem!
     
    xFoxiu, RiverHu, t_lith85 and 2 others like this.