Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Visual Studio always gets reloaded. Slow production for projects with more assembly definition files

Discussion in 'Editor & General Support' started by davenirline, May 14, 2018.

  1. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    I thought that the more assembly files, the faster the production due to lesser compile time. This is simply not true because the price of more assembly files is slower usage of Visual Studio, especially in Unity 2018. Somehow, there are unknown cases where Visual Studio gets reloaded, which means all projects have to be reloaded (one project per assembly definition). The process is so slow that it's faster to kill Visual Studio and reopen it instead. This is such a productivity vortex that I regret using assembly definition files.

    Is there any workaround for this?
     
    Tony_Max likes this.
  2. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    I've narrowed it down. Everytime I open an asmdef file as a text file (needed to manually add references like Unity.Entities), Visual Studio gets reloaded. It unloads then reloads each asmdef project. We have over 100. This is so annoying! I have to open the asmdef file in another editor?
     
  3. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Same over here. Since Unity 2018 just opening a single C# script or double clicking on an assert line can be painfully slow. Hoping for a fix.
     
  4. rustinlee

    rustinlee

    Joined:
    May 31, 2014
    Posts:
    20
    Having the same issue as Alejandro, we haven't been using additional assembly definition files but since upgrading to 2018.1.1f1 opening Visual Studio Community 2017 v15.5.6 to a certain file/line has become unbearably slow (10+ seconds every time as it "reloads" and then "unloads" project files). The slowdown happens every time context is returned to Visual Studio after a recompile.
     
  5. shawnblais

    shawnblais

    Joined:
    Oct 11, 2012
    Posts:
    324
    Same here, this is driving me absolutely crazy.

    QUALITY CONTROL guys.

    If I delete the .SLN file, then my scripts open lightning fast again. But then, after 20 or 30 minutes, this annoying 20 second delay starts happening. Even if the script file is currently open in VS, double-clicking it in Unity will cause the entire VS project to reload itself, and lockup for 15-20seconds.

    Every. Single. Time.
     
    chadfranklin47 likes this.
  6. sier_ua

    sier_ua

    Joined:
    Jan 19, 2017
    Posts:
    6
    Same here. Very annoying. Has anyone found a solution?
    EDIT: this problem has been fixed by updating Unity version to 2018.1.5f
     
    Last edited: Jun 21, 2018
  7. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    Really? I'll try it.

    Edit: I tried it. Nope, not fixed yet. As long as you have the Incremental Compiler, this excessive unload/reload happens. So you can't use ECS because it requires IC.
     
    Last edited: Jun 22, 2018
  8. TJD269

    TJD269

    Joined:
    Oct 17, 2017
    Posts:
    19
    Also having the same issue on 2018.2, so it was not fixed it that version. Also just updated from 2017.1, so will try deleting the SLN file and see if it comes back. Painfully slow opening any script what so ever... rest of the new unity is much faster though.

    Edit: Tried deleting the sln and it does actually fix it but only very temporarily. After a few more scripts are opened the long reload times come back.
     
    Last edited: Jun 27, 2018
  9. Evgeny-Eliseev

    Evgeny-Eliseev

    Joined:
    Jan 21, 2015
    Posts:
    19
    Assembly Definition is a very useful feature. But with this problem we need to rollback to default assemblies. Unity guys, please fix this!
     
  10. sier_ua

    sier_ua

    Joined:
    Jan 19, 2017
    Posts:
    6
    WinterboltGames likes this.
  11. TJD269

    TJD269

    Joined:
    Oct 17, 2017
    Posts:
    19
    Hey man I'm gonna try this out right now. Thanks a ton for the reply, I'll let you know if it works!

    Edit: Seems to work great again and even faster at loading scripts than before! Thanks again for the help!
     
    Last edited: Jul 3, 2018
  12. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
  13. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    I was having this problem too. However, I just upgraded to 2018.2 (not beta) and it seems to have been fixed.
     
  14. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    969
    That's good to hear. I'll test it.
     
  15. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    You can disable the automatic reloading in the settings of the vs tools plugin for vs.

    I don't know if it helps when editing asm defs, but it does help in that you can chose to ignore (in thwt dialog bös that pops up) sln and csproj reloads.
     
  16. pvloon

    pvloon

    Joined:
    Oct 5, 2011
    Posts:
    591
    I'm still having this issue in 2018.2, and after upgrading to latest unity VS tools and such. It's driving me mad.

    What's the status on this?
     
  17. WinterboltGames

    WinterboltGames

    Joined:
    Jul 27, 2016
    Posts:
    259
    sier_ua likes this.
  18. FlightOfOne

    FlightOfOne

    Joined:
    Aug 1, 2014
    Posts:
    668
    Mine was fixed for good after 2018.2. I have already updated twice now and I am currently at 2018.2.2f1. Haven't seen this problem(I probably jinxed it)

    FYI -I have "Detect when file is changed outside the environment" checked and "Reload modified files unless there are unsaved changes" UNchecked.
     
  19. TheBlatantOne

    TheBlatantOne

    Joined:
    Feb 2, 2014
    Posts:
    4
    Updating VS Unity Tools worked for me too.