Search Unity

Resolved "Project file has no matching compilation unit" Error with Local Package

Discussion in 'Editor & General Support' started by SomeGuy22, Feb 13, 2021.

  1. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    A while ago I imported a package which contained an .asmdef file and some code which works as expected but Unity keeps throwing an annoying error whenever I try to do anything. Here's the full log:

    It seems as though it can't find a "compilation unit" perhaps a .csproj that is missing? But it should just add a new one to my current solution right? The only way I've been able to remove the error is to delete the .asmdef file but that leaves the GUI functions it supports broken so I'd prefer not to do that.

    I'm using Unity 2019.4.14f1 with Visual Studio 2017. I have noticed this issue with Unity 2019.3.x in previous projects with other imported packages but now it's just getting even more annoying. There has to be some way to fix this, I've tried updating the Unity VS Bridge but it says it is already up to date. I'm not keen on updating to Visual Studio 2018 or later but if there's an update for 2017 that could potentially fix this I'd be happy to try it out.

    I'd appreciate any thoughts or suggestions if anyone else has come across this. Thanks for the help!
     
  2. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Welp, 30 mins later and I had already guessed the solution in the above post.

    I tried manually updating VS 2017 by hitting the "check for updates" button, was able to keep the 2017 version and apparently it has upkeep into 2021. It installed version 15.9, so I restarted it and Unity. Now when I check the solution projects it shows this:



    When before this project would show up as "missing". I guess the newest version of VS 2017 is just able to generate the project when before it would fail? Perhaps it has to do with the package being outside of the Assets folder because it uses the package system/links from an external folder, and VS might have had trouble with that. Regardless, now the project shows up and the error is gone. I should've known it would be that simple all along. Hope this helps anyone that comes across this issue!