Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Issues with Visual Studio + Unity

Discussion in '2018.2 Beta' started by LeonhardP, Jan 25, 2018.

  1. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,974
    Unfortunately posting on the forums is not a substitute for submitting bug reports. Our devs and QA have to juggle with a lot of different cases, and adhering to a managed method of bug reporting allows us to properly process and prioritise them. If you want to help or make sure that an issue that is troubling you gets fixed sooner, you should submit a bug report.
     
  2. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    VS today asked us to update, so we naturally pressed accept. This caused VS to have an error in installation and we've had to wipe it from the computer and reinstall via the Unity download manager again. Anyone else have this issue?
     
  3. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    125
    Can confirm, the infinite reloads were solved by upgrading to 15.7. Let's hope some similarly annoying bug doesn't appear in 15.7 (and/or VSTU 3.7).

    No, everything went smoothly for me on 3 different PCs/configurations.
     
  4. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    We're on mac.
     
  5. eobet

    eobet

    Joined:
    May 2, 2014
    Posts:
    176
    I can't get code completion to work at all, and I got a tip about installing Visual Studio Tools for Unity from Microsoft, but that didn't do anything.

    Also, you are forcing Microsoft data harvesting upon us now by switching to an app that requires a valid e-mail login... :(

    I'm going to try this Rider thing now that I saw mentioned in this thread.

    EDIT: Oh, is this another Microsoft issue?

    I thought it was a bad asset. I have no idea what your solutions means thought. When is there an official fix? Unity 2018.2.0b4?

    EDIT: Rider install had a few extra steps, but done now. So far, no issues and works better than Visual Studio, even in 2018.2.0b3. Thank you for the tip, guess they got another paying customer (and Microsoft got a privacy agreement that I didn't really want to agree to).
     
    Last edited: May 10, 2018
  6. Seto

    Seto

    Joined:
    Oct 10, 2010
    Posts:
    230
    The reload still need a long time with 15.7.1 + VSTU 3.7 + unity 2018.1 my project is with 38 asmdef.
     
  7. XOA_Productions

    XOA_Productions

    Joined:
    Nov 27, 2016
    Posts:
    24
    Hey there!

    Not sure if anyone before me has mentioned the following issue, sorry if that's the case.

    Basically, VS 2017 does not sync its solution with unity anymore.
    I'm not entirely sure what caused this. I started off our project on 2018.2.0b3 using VS15 and later on switched over to VS17. This caused some bugs initially that were not resolved by changing back to 2015, so I stayed on 17. At some point I then noticed, that when creating new scripts inside unity and double clicking to open them, VS does not treat them as if they belong to the current solution. Thus, intellisense and other features won't work.
    Before, one could simply quit VS and restart and it would recognize the new script as belonging to the solution and everything would work again.
    Now however, nothing solves this issue except manually dragging the script or folder into the solution explorer, which is fine for stuff I create myself, but gets anoying when importing other assets. Also, even after I've dragged it into the solution explorer, VS will not recognize changes like dragging the file into a different folder in unity or deleting it (It doesn't even notice that the file isn't in the previous folder anymore, which often causes me to accidentally save the file to the wrong folder when it's still open in VS).

    I already tried the following things to solve the problem:
    • Restart VS
    • Open the code project via the MenuItem
    • Open the code via double-clicking a c# script
    • Deleting all .csproj and .sln files as well as the .vs folder in the project
    • Using VS2015 again, which had the same problems
    • Trying to reload the solution via the button in the solution explorer
    • Reinstalling Unity 2018.2.0b3
    I hope this helps you guys out or you can point me towards a solution for this issue.

    Regards
    -Ben
     
    Last edited: May 11, 2018
    Jes28 likes this.
  8. MisterMashu

    MisterMashu

    Joined:
    Oct 23, 2012
    Posts:
    4
    my visual studio crashes about 1 or 2 seconds after loading the code file. I have tried tweaking all the settings I can think of and still it just simply crashes. I can't code at all. please help!
     
  9. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    758
    Done @LeonhardP @lukaszunity

    Case 1037523
     
    LeonhardP likes this.
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    476
    CoCoNutti likes this.
  11. lancol

    lancol

    Joined:
    Jun 30, 2013
    Posts:
    2
    I had a lot of the issues mentioned in the comments here as well: "ArgumentException: Value does not fall within the expected range." and a solution file not generating on new projects.

    I finally got everything working again simply by switching back from Visual Studio 2017 to 2015. Good luck to everyone.
     
  12. CoCoNutti

    CoCoNutti

    Joined:
    Nov 30, 2009
    Posts:
    506
    What a shock that VS is full of errors and crashes.
    Why oh why do we have to use this Microsoft crap? :(
     
    friuns3 and SaltwaterAssemnly like this.
  13. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    550

    Does it was fixed?

    I have Visual Studio 15.8.0, Tool for Unity 3.7.0.1, Unity 2018.1.0f2 and have exactly these issues in VS
     
  14. recursive

    recursive

    Joined:
    Jul 12, 2012
    Posts:
    645
    I haven't checked, I've been using VS code for my personal stuff because of those and a few other issues. I'll check it again after I get my home PC back in working order (ran out of space on my OS drive just got a replacement).
     
  15. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,014
    So, I am still experiencing massive solution reloads with nearly every action with latest VS and Unity 2018.1. These reloads take a good few minutes to happen for some reason as it takes forever to go through each csproj for some odd reason. I have to always just kill the process and start it up again since it only takes a few seconds to actually load VS and the project...

    As you might understand, this is a massive hamper on my ability to work. I'm using the new incremental compiler now, not sure if that's causing the issue but pretty sure this was happening before I tried switching to it as well.
     
  16. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    89
    Hello,

    As @LeonhardP said, the best way for getting help with advanced issues is to submit bug reports. This way we can properly track and prioritize everything. Microsoft and Unity teams are working together daily to solve your issues.

    We really need minimal reproduction projects for those bugs! That’s super important for us, because so many times it was a very project-specific thing that was causing an issue.

    We made a troubleshooting page to help you solve common issues with Visual Studio (you can even add your own comments or add extra content):

    https://docs.microsoft.com/en-us/vi...nd-known-issues-visual-studio-tools-for-unity

    The best way to quick solve issues is to be sure you are using the latest Visual Studio and Unity versions (when possible of course).

    Regarding the specific issue with duplicate types (hit by @recursive and @Jes28), I think this is a Unity Issue that was just fixed this week with project generation. Using the following script (in an Editor folder) should workaround the issue:

    https://gist.github.com/sailro/5f6b46b1bf9e6c507d19230538c8e9c2

    Regards
    Sebastien Lebreton [MSFT]
     
    hippocoder and LeonhardP like this.
  17. AdrianaSolerHuete

    AdrianaSolerHuete

    Joined:
    Jul 14, 2017
    Posts:
    1
    It is not posible to run a Hololens app in VS 2017 using Hololens emulator if you have IL2CPP Scripting Backend in Unity, there is no option. I need help!! I can not use .NET because some libraries.

    upload_2018-5-26_14-22-34.png
     
  18. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    95
  19. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,974
    We have a fix for this that is currently being reviewed.
     
  20. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    95
    So is it possible that gets into 2018.1.3? Thanks.
     
  21. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,729
    Don't want to hijack, just wondered if the problem with the Incremental compiler failing to jump to error line numbers lies with Unity beta, VS or just the Incremental Compiler? I suspect the latter so don't mind me - just leaving a note.
     
  22. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,974
    Once approved, the fix will also be backported to 2018.1.
     
  23. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    86
    I'm not 100% sure this is the right place to ask this question, however, is there any way to get Visual Studio Code to compile Unity code before switching back to Unity? Other IDE has been able to do this.
     
    SaltwaterAssemnly likes this.
  24. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    599
    I have done everything said here. My VSTU is 3.7.0.1. Visual Studio is 15.7.3. Installed targeting packs. Deleted solution and project files. It's still the same. Every asmdef project gets unloaded/reloaded making the IDE unusable. Worse, I get compile errors all over. The System namespace could not be found.
     
    CoCoNutti likes this.
  25. Jes28

    Jes28

    Joined:
    Sep 3, 2012
    Posts:
    550
    Trying this script. It works and adds tags to project but VS still have bug of duplicate types
     
  26. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    60
    2018.2.0b6 still has this issue. The script works for me though.
     
  27. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    599
    I managed to fix the compile errors. It's caused by an asset. But the excessive unload/reload still persists. Still can't use Unity 2018 for our project.
     
  28. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    599
    The reload time is very bad. We have 100+ asmdef files so it takes too long for VS to be usable again. It's faster to kill Visual Studio and reopen. But even then, that is still a productivity sink.

    I'd love to try this update. How can this be done?
     
    CDF and SaltwaterAssemnly like this.
  29. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82

    Actually, we did this (submitted a bug) and your QA's response to me was not to report to you but to go to Microsoft directly (who aren't helping either).
     
  30. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    **. Have to reinstall vs............again after update
     

    Attached Files:

  31. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    758
    Do you know in what version will be included? It's been more than a month already... Thanks.
     
  32. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    599
    I just want to add that the Incremental Compiler is causing this excessive unload/reload. We're able to use Unity 2018 now be we can't use ECS because it requires the Incremental Compiler.
     
  33. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    60
    Has anybody else noticed in 2018.2.0b9 that errors and warnings in the Editor Console aren't directing to Visual Studio source file and line number anymore/only intermittently? Is it something others are noticing (a bug) or is it just me? Debug.Log messages ARE still being directed to Visual Studio, file and line.
    Unity 2018.2.0b9. Visual Studio Community 15.7.4.
     
  34. SaltwaterAssemnly

    SaltwaterAssemnly

    Joined:
    Mar 8, 2016
    Posts:
    82
    Thanks will try this.
     
  35. TJD269

    TJD269

    Joined:
    Oct 17, 2017
    Posts:
    18
    Any progress on this fix? I have upgraded to 2018.2 yesterday and I cannot open a script without it taking 1 minute each time because it still opens my whole project back in VS. Deleting the .sln does speed it up for a little, but it always comes back after 20 mins or so. This is dramatically affecting my development time.

    Thanks!
     
  36. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,974
    The good news is that the fix made it into trunk. Unfortunately it hasn't been backported to 2018.1 / 2 yet. Seems like some internal issues resulted in a delay of this process. It's most likely going to be in a patch release at this point. I'll reply once I know more. We're sorry for the inconvenience.
     
  37. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    569
    Hi @jbevain and @sailro. I would like to know when Visual Studio will support adding package from Package Manager automatically as a project inside Visual Studio solution and able to debug?
     
  38. TJD269

    TJD269

    Joined:
    Oct 17, 2017
    Posts:
    18
    Hi there I did actually fix it and I'm on 2018.2.0b9:

    Yes, my fix turned out to be temporary as well.
    But I've got it finally fixed. Solution is to update Visual Studio Unity tools.
    See the following post for references:
    https://forum.unity.com/threads/issues-with-visual-studio-unity.514304/#post-3409391

    Though I am compiling every shader now with each build because of a single pass stereo for VR which is super annoying.
     
    Last edited: Jul 6, 2018
  39. daserra

    daserra

    Joined:
    Dec 7, 2016
    Posts:
    14
  40. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    1,974
unityunity