Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Issues with Visual Studio + Unity

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

  1. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Glad to hear. The cleaning part isn't a big deal right now, my script I posted earlier already cleans out the includes from other assemblies from each csproj, since Unity provides the API to see all current assembly definitions and their pertaining folder.
     
  2. jbevain

    jbevain

    Microsoft

    Joined:
    Feb 22, 2012
    Posts:
    141
    Thinking about it, another thing would be for you to request that Unity generates the csproj at the same location of the asmdef.
     
  3. lukaszunity

    lukaszunity

    Administrator

    Joined:
    Jun 11, 2014
    Posts:
    461
    We don't want to generate the .csproj in the Assets folder, since the folder is versioned and the .csproj files are generated. We have it on our backlog to generate the .csproj's in a folder like "CSProjects" in the root, so they do not clutter the root of the project.
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Cluttering the root of the project isn't the issue though, it's that each csproj is filled with includes for all the stuff from other assembly definitions and stuff outside of asmdef folders, and that it also includes the whole path to the asmdef's folder in the solution view because of the project root location of the csproj files.

    The versioning system already has the capability to ignore certain file types, why wouldn't .csproj be added to that ignore list? It shouldn't need to be shared on versioning since it's frequently regenerated.
     
    jbevain and Peter77 like this.
  5. SynergiAios

    SynergiAios

    Joined:
    Feb 3, 2015
    Posts:
    35
    Screenshot_1.png Sr if this has already been reported. I just wanted to show what was happening today to my Solution when I opened it :( For me it is not a problem Source Control fixed it of course x) just wanted to show if it wasn't already reported.

    Ok Damn it x) Everytime I open the project this happens. Do I have to go back to release candidate or is there a possible fix for this?
     
  6. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Even better... just parse and update the .csproj and don't regenerate it! That way we can make our own manual changes to it when needed.
     
    z00n, jbevain, Peter77 and 1 other person like this.
  7. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Just to keep a hand on the pulse: still perfectly reproduces with Unity 2018.1b12, VS 15.6.4, VSTU 3.6.0.59
    upload_2018-3-24_20-20-16.png
     
  8. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    254
    Still not fixed in Beta 13 :( So frustrating that the VS project keeps reloading.
     
  9. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @SketchWork, could you send me an email here: vstusp[at]microsoft[dot]com.
    I would like to see how we could solve your issue.
    Thanks!
     
    SketchWork likes this.
  10. TurleyE

    TurleyE

    Joined:
    Nov 2, 2015
    Posts:
    10
    I had loads of problems with the Mac VS integration. Scripts couldn't compile, as they were looking for libraries in the Packages folder. Adding any packages would then error as well, meaning Autocomplete wouldn't work. VS updates would end up corrupting the app, so dreamweaver would load instead. After a number of reinstalls from the Unity Installer, of VS on it's own, everything, fresh installs etc nothing would work. What fixed everything for me was to delete the Unity installed Visual Studio app from Applications and install it from the Visual Studio website (https://www.visualstudio.com/vs/mac/), after which everything is working perfectly, along with updates not corrupting.
     
    SaltwaterAssembly likes this.
  11. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
  12. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @watsonsong. What is the VSTU version you are using ?
     
  13. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    @sailro, I am using visual studio 2017 community.
     
  14. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Thanks, I mean the exact VSTU version. If you have something >= 3.6.0.5, Unity is fully handling the project generation now. If you have something older, you should upgrade.
     
  15. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
  16. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    VS is bugging me with messages like this:

    vsfm.png

    ever since I installed TextMesh Pro from the Package Manager. I have to skip all over each module,and though this process every time I try to open a file, which is a extremely slow process, even worst, if I rename a file, it seems that once it finishes it starts all over again and again and so on. I waited over an hour for a file to open, then I tried to kill VS form the Task Manager, but VS kept restating itself or Unity kept restarting it (I can't tell for sure), but the fact is that VS only became stable once I closed Unity.

    To recover from this problem I had to to reinstall all packages, I don't know if the order in which packages are installed has something to do with this issue, but just to be sure I installed TextMesh Pro first.

    I think someone should really do a stress test which includes aggressively renaming all C# files on a project, because as far as I can tell, renaming C# files is major source of issues with VS.
     
  17. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @georgeq, we are currently working on solving this kind of issue with Unity.

    Sebastien Lebreton [MSFT]
     
  18. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Thanks, I'm glad to know you're aware of this problems.
     
  19. theFrenchDutch

    theFrenchDutch

    Joined:
    May 5, 2014
    Posts:
    25
    Currently on Unity 2018.1.0 b13 and VSTU 3.6.0.5. Ever since I jumped on the beta, there has been no way to work on shader files correctly with VS 2017.
    .compute and .cginc files have no highlighting or anything at all, and .shader files have highlighting, but half working (things like return and #include are not highlighted for some reason).

    Is there a reason for this ? I saw no one mentionning issues with shader files here. I have already tried reinstalling VS2017 entirely and the VSTU
     
  20. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    @theFrenchDutch, could you double-check if the "Desktop Development with C++" workload is installed in your VS2017 ? (run the VS installer, click More/Modify). For historical reasons the shader support is bundled with this workload (reusing the c/c++ parser).
     
  21. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hello friends,

    For those having issues with extra reloads, or VS losing all open windows, you should check that you have the proper .NET targeting pack. If you are using the new runtime for instance, make sure that you have the .NET Framework 4.6 Targeting Pack installed (Because the csproj will use a TargetFrameworkVersion=4.6 in this case).

    This simple fix sorted all reloading issues hitting @SketchWork.

    When you don’t have the proper targeting package, you’ll see such a dialog message:
    upload_2018-4-9_16-9-36.png

    This is not to be taken lightly because this is a hint that something is wrong, breaking the interaction between VS and Unity.

    You can use the VS2017 installer to fix that (modify the installation, go to individual components tab, .NET category, and check all 4.x targeting packs). If you are still on VS2015 you can install standalone packages.

    upload_2018-4-9_16-15-22.png

    Going forward, we’ll make sure that VS2017 will install all necessary targeting packs for you.

    Thanks!
     
    nirvanajie and SketchWork like this.
  22. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Sometimes, after recompilation, when clicking in console to open the file with the error, VS completly freezes. Does anyone else experience this error too?

    VS 2017 (latest one), VSTU 3.6.0.5, Unity b13.
     
  23. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    104
    It doesn't freeze for me but it takes ages to "reload" the project. It really loads everything again, including thingies imported with the new Package Importer thing
     
  24. Skaarah

    Skaarah

    Joined:
    Aug 2, 2014
    Posts:
    3
    I'm unable to attach a debugger now. It throws an error and then says it failed to load the assembly.
     
  25. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey guys!

    Any news on duplicate tabs issue? Should I report it somewhere else?

    Thanks!
     
  26. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi Dmitriy, I am monitoring this on our side, and it seems that several issues were fixed.

    So could you try the following:

    - Upgrade VS to the latest version (15.6.6)
    - Remove all your autogenerated solution/project files, and the ".vs" folder.
    - Regenerate

    Next step if you are still hitting the issue is to fill a ticket on https://developercommunity.visualstudio.com
    This way we can keep this under our radar and track progress.

    Thanks!
    Sebastien Lebreton [MSFT]
     
    codestage likes this.
  27. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey,

    Thanks for the quick reply, Sebastien!

    I've successfully reproduced it with latest VS and after removing all vs files in unity project folder.
    And before submitting a bug I've decided to try reinstall VS, just in case it's something cached etc and it helped - now I can't reproduce problem anymore. Will post here any news if I'll have them about this case.

    Thank you!
     
    sailro likes this.
  28. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @jbevain, currently Visual Studio 2017 can backward compatible until which older Unity version?
     
  29. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @jbevain and @sailro. Currently I would like to have something like when I hit save code file at Visual Studio, Unity will directly start compiling the code file without needing to switch back to Unity.

    Another feedback I want to give is I would like to see Unity and Visual Studio can sync very well to get better speedup in future. Are u guys working on REST server feature currently?
     
  30. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @Optimize, to answer your questions:

    1- regarding versions, all versions we release are tested against 2018.x, 2017.x, 5.6 and 5.5. But we should be compatible with older Unity versions. I know we have users still using 5.4 or 4.7.

    2- yes we always want to have better integration between Unity and VS as well. We are not supporting the REST server so far but we are currently working on a new project system and perhaps we'll include support for it, if it's something still actively supported on the Unity side.

    Regards
    Sebastien Lebreton [MSFT]
     
    optimise likes this.
  31. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    Yes, it really just takes AGES to reload, making me kill VS and start it again multiple times a day.

    Could you confirm if this is a known issue from your side or not, @sailro?
     
  32. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    @pavelkouril

    So far, all those extra reload issues were solved by the following:
    1. Upgrading to the latest VS/VSTU versions (VSTU 3.7.x +)
    2. Checking that all proper targeting packs are installed (.NET 4.7.1 and .NET 4.6)
    3. Checking that you don’t have AssetPostProcessors or external tools touching project files (if you really need to do this we have an API).
    A troubleshooting page is available here.

    Regards
    Sebastien Lebreton [MSFT]
     
  33. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    @sailro I guess VSTU 3.7.x will become available with VS 15.7? Because I have the latest VS + VSTU available to me (15.6.6 and 3.6.0.5), and this is happening; I'll check the targeting packs, but since the project still has the old mono runtime, I don't think I need the new targeting packs?

    As for the asset post processors touching the project files, I don't think we have that in tte project, but I'll double check. But for what it's worth, opening the solution in VS always changes one project file and wants to save it upon closing VS. I'll try to check the changes done to the project file, if that can give relevant info?
     
  34. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    @pavelkouril, indeed VSTU 3.7.x will be available with VS 15.7 (and you can already use it with the current 15.7 preview 4). With the legacy mono runtime, no additional targeting pack is required.

    Regarding the project file unexpected changes, yes please send us the diff, this is probably why you are experiencing issues.

    Regards
    Sebastien Lebreton [MSFT]
     
  35. pavelkouril

    pavelkouril

    Joined:
    Jul 22, 2016
    Posts:
    129
    The diff is adding one item group at the end of the project file, as can be seen below:

    Code (csharp):
    1.  <ItemGroup>
    2.     <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
    3.   </ItemGroup>
    4.  
     
  36. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    Looks like this was already reported before and fixed in preview.

    https://developercommunity.visualst...s-156-automatically-adds-entry-to-csproj.html

    So once you update to preview it should be good.
     
    sailro likes this.
  37. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Indeed, this should be fixed with 15.7.
     
    pavelkouril likes this.
  38. MartinIsla

    MartinIsla

    Joined:
    Sep 18, 2013
    Posts:
    104
    Infinite reload times for Visual Studio were fixed when I updated VS!
    Now it doesn’t even load the packages from the Package Manager (which is great)
     
    pavelkouril likes this.
  39. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    I installed VS 2017 and it replaced the existing version of the VSTU with 1.0.0.0 and I can't debug anything. Microsoft is not providing a link to download the latest version for 2017 because it is embedded on the installer, so if you have the same problem go to the VS installer and install the VSTU.
     
    Last edited: May 2, 2018
  40. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    @sailro @jbevain

    I recreate the thread on Unity 2018.1b because I still have problems.

    In my case I get a different *.sln file depending on Unity version.

    Unity 2017.3.1f1 (CORRECT):

    Unity 2018.1.0f2 (WRONG):

    If you pay attention, the problem is that in 2018 version it generates the projects with the same name. That's causing problems when running commands like "msbuild" that I get:

    I don't know why but with VS 2017 editor it works, my problem is running it (msbuild) from command line with Jenkins.
     
  41. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    Thanks for tips & pointers to resolve this build error.

    Well I decided to dork around with Unity 2018.2.0b2++ and am trying to adapt to this IL2CPP scripting backend. I know from using it in the past it causes trouble. Oddly it seems to have less trouble with webGL than with Microsoft and Android platforms.

    I am on Windows 10 201804 Release with i7-3630 UM and Intel HD Graphics 4000 with 16GB RAM on an HP 8470P Elitebook.

    Anyway I have the latest version of Infinite Runner Pro (with the Unity.SocialNetworking.GameCenter stuff commented out)

    configured with
    +++++
    Scripting Backend: .Net 4.x Equivalent
    Scripting Backend: IL2CPP
    API Compatibility Level: .NET 4.x
    C++ Compiler Configuration: Release
    +++++

    I have color space set to Linear. & Lightmap Encoding set to High Quality but other wise all other configuration fields are hum-drum.

    I have installed just this week updated to the newest Visual Studio 2017 Enterprise with the newest Windows 10 SDK. The VS 2017 Enterprise is configured correctly in Unity via preferences.

    My build target is Windows x86_x64 Standalone.

    So I can build for Mono but not the IL2CPP here is the error. It seems to say that I don't have VS 2017 & the Windows 10 SDK installed.

    It gives me 3 errors messages as follows:

    +++++
    Code (CSharp):
    1. Failed running C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityjit" --compile-cpp --libil2cpp-static --platform="WindowsDesktop" --architecture="x64" --configuration="Release" --outputpath="C:\bin\Unity\Holiday Road\Temp/StagingArea/Data\Native\GameAssembly.dll" --cachedirectory="C:\bin\Unity\Holiday Road\Assets\..\Library/il2cpp_cache" --map-file-parser="C:\Program Files\Unity\Editor\Data\Tools\MapFileParser\MapFileParser.exe" --assembly="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\Managed\Assembly-CSharp.dll" --assembly="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\Managed\Assembly-UnityScript.dll" --assembly="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\Managed\BitStrapRuntimeAssembly.dll" --assembly="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\Managed\UnityEngine.UI.dll" --assembly="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\Managed\UnityEngine.dll" --generatedcppdir="C:\bin\Unity\Holiday Road\Temp\StagingArea\Data\il2cppOutput"
    2.  
    3. stdout:
    4. il2cpp.exe didn't catch exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
    5.        Visual Studio 2010 with C++ compilers and Windows 7 SDK (it cannot build C++ code because it is not installed)
    6.        Visual Studio 2010 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir" in the registry
    7.        Windows 7 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" in the registry
    8.  
    9.        Visual Studio 2013 with C++ compilers and Windows 8.1 SDK (it cannot build C++ code because it is not installed)
    10.        Visual Studio 2013 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\12.0_Config\InstallDir" in the registry
    11.        Windows 8.1 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1\InstallationFolder" in the registry
    12.  
    13.        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
    14.        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
    15.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    16.  
    17.        Visual Studio 2017 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
    18.        Visual Studio 2017 installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
    19.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    20.  
    21.  
    22.   at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    23.   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    24.   at il2cpp.Program.DoRun(String[] args)
    25.   at il2cpp.Program.Run(String[] args)
    26.   at il2cpp.Program.Main(String[] args)
    27. stderr:
    28.  
    29. Unhandled Exception: System.InvalidOperationException: C++ code builder is unable to build C++ code. In order to build C++ code for Windows Desktop, you must have one of these installed:
    30.        Visual Studio 2010 with C++ compilers and Windows 7 SDK (it cannot build C++ code because it is not installed)
    31.        Visual Studio 2010 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\10.0_Config\InstallDir" in the registry
    32.        Windows 7 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" in the registry
    33.  
    34.        Visual Studio 2013 with C++ compilers and Windows 8.1 SDK (it cannot build C++ code because it is not installed)
    35.        Visual Studio 2013 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\12.0_Config\InstallDir" in the registry
    36.        Windows 8.1 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1\InstallationFolder" in the registry
    37.  
    38.        Visual Studio 2015 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
    39.        Visual Studio 2015 installation is found by looking at "SOFTWARE\Microsoft\VisualStudio\14.0_Config\InstallDir" in the registry
    40.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    41.  
    42.        Visual Studio 2017 with C++ compilers and Windows 10 SDK (it cannot build C++ code because it is not installed)
    43.        Visual Studio 2017 installation is found using Microsoft.VisualStudio.Setup.Configuration COM APIs
    44.        Windows 10 SDK is found by looking at "SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0\InstallationFolder" in the registry
    45.  
    46.  
    47.   at Unity.IL2CPP.Building.CppProgramBuilder.ThrowIfCannotBuildInCurrentEnvironment()
    48.   at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    49.   at il2cpp.Program.DoRun(String[] args)
    50.   at il2cpp.Program.Run(String[] args)
    51.   at il2cpp.Program.Main(String[] args)
    52.  
    53. UnityEngine.Debug:LogError(Object)
    54. UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:128)
    55. UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    56. UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:380)
    57. UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(ICollection`1, String, String, Boolean) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:361)
    58. UnityEditorInternal.IL2CPPBuilder:Run() (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:178)
    59. UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
    60. DesktopStandalonePostProcessor:SetupStagingArea(BuildPostProcessArgs, HashSet`1) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:238)
    61. DesktopStandalonePostProcessor:PostProcess(BuildPostProcessArgs) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:41)
    62. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    +++++

    Code (CSharp):
    1. Exception: C:\Program Files\Unity\Editor\Data\il2cpp/build/il2cpp.exe did not run properly!
    2. UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:130)
    3. UnityEditorInternal.Runner.RunManagedProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/BuildUtils.cs:73)
    4. UnityEditorInternal.IL2CPPBuilder.RunIl2CppWithArguments (System.Collections.Generic.List`1[T] arguments, System.Action`1[T] setupStartInfo, System.String workingDirectory) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:380)
    5. UnityEditorInternal.IL2CPPBuilder.ConvertPlayerDlltoCpp (System.Collections.Generic.ICollection`1[T] userAssemblies, System.String outputDirectory, System.String workingDirectory, System.Boolean platformSupportsManagedDebugging) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:361)
    6. UnityEditorInternal.IL2CPPBuilder.Run () (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:178)
    7. UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:42)
    8. DesktopStandalonePostProcessor.SetupStagingArea (UnityEditor.Modules.BuildPostProcessArgs args, System.Collections.Generic.HashSet`1[T] filesToNotOverwrite) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:238)
    9. DesktopStandalonePostProcessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/DesktopStandalonePostProcessor.cs:41)
    10. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    11.  
    +++++

    Code (CSharp):
    1. Build completed with a result of 'Failed'
    2. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    3.  
    +++++

    Code (CSharp):
    1. UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    2.   at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187
    3.   at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
    4. UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
    5.  
    +++++
     
  42. SaltwaterAssembly

    SaltwaterAssembly

    Joined:
    Mar 8, 2016
    Posts:
    95
    Since installing 2018 last night, VS crashes on a regular basis without warning. Only message we get is a fatal warning, and that's it, no other detail. Anyone else having issues (running on Mac)?
     
  43. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    167
    Hi @bdominguezvw,

    Indeed something changed.

    Before 2018, we were handling the solution and project generation.
    Starting with 2018.1, Unity is now generating the solution and project files, and we hook into this process to add our stuff.

    So adding @lukaszunity to this thread, for a potential fix on the Unity solution generation.

    Regards
    Sebastien Lebreton [MSFT]
     
  44. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,182
    I resolved my problem by uninstalling and reinstalling VS 2017 Enterprise with needed subsystems. I don't know why the Windows 10 201804 upgrade messed it up or why the same upgrade has made about 25GB of SSD disappear (Windows-old and the Restore to previous state are gone as I deleted them so that's not were the 25GB has went).

    Anyway thanks. I am glad it works now.
     
  45. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Hi @sailro,can you make

    1) Unity auto compile the script after hitting save at Visual Studio instead of hitting save at Visual studio then going back to Unity in order to compile the script?

    2) IntelliSense able to add find and add something that is not added using namespace yet?

     
    Last edited: May 5, 2018
  46. Fijit

    Fijit

    Joined:
    Sep 1, 2011
    Posts:
    7
    @optimise In case it helps, I just press Shift-F6 when editing code in VS, it will save and build. Unity will perform a reload in the background immediately (assuming auto-refresh is on and your code compiles) and will be ready to roll when you switch back to it.
    I'm assuming this works in a standard/fresh setup ofc, I may have tinkered with settings in the past :)
     
  47. Krisztian-Leicht

    Krisztian-Leicht

    Joined:
    Sep 10, 2015
    Posts:
    6
    Hello all!

    I have the following problem when using Unity with VS + VSTU:
    Basically every time I create a new script, or delete an existing one, Unity recompiles every single AsmDef + Predefined dll there is in the project.
    However the problem is, in our case, that if I set external script editor to VS, than Unity hangs for a good 30 seconds before starting compiling these assemblies.
    In the editor there is only a "Total AssetImport time" entry nothing else that would indicate any error.
    I tried with
    Unity 2017.3f1, 2018.1f2, 2018.2b2,
    Visual studio: 15.6.5 - 15.6.6 || 15.7 Preview 6
    Visual Studio for Unity: 3.6.0.5 || 3.7.0.1
    in every version the same problem appears.
    We have in our project about 1700 files using 50 asmdef.

    Couple of measurements I made using 2018.1f2 with 1700 files and 50 asmdef, create a new script in an asmdef folder that has no other asmdef reference:
    Edit -> Preferences -> External Tools -> External Script Editor:
    Set to: Open by file extension
    Script creation freeze: ----- Total AssetImport time: 0.534815s
    Script delete freeze: ----- Total AssetImport time: 0.685875s

    Set to: Rider 2018.1
    Script creation freeze: ----- Total AssetImport time: 6.469111s
    Script delete freeze: ----- Total AssetImport time: 7.225926s

    Set to: Visual Studio 15.7 Preview 6 ( not much difference between VS versions )
    Script creation freeze: ----- Total AssetImport time: 34.650668s
    Script delete freeze: ----- Total AssetImport time: 34.915822s
    Project reload time: 6-8 seconds

    -------------------------------------------------------

    (1700 files without any asmdef):
    Set to: Open by file extension
    Script creation freeze: ----- Total AssetImport time: 0.533041s
    Script delete freeze: ----- Total AssetImport time: 0.653921s

    Set to: Rider 2018.1
    Script creation freeze: ----- Total AssetImport time: 0.523475s
    Script delete freeze: ----- Total AssetImport time: 0.614132s

    Set to: Visual Studio 15.7 Preview 6
    Script creation freeze: ----- Total AssetImport time: 1.477592s
    Script delete freeze: ----- Total AssetImport time: 1.581576s
    Project reload time: 1-2 seconds

    I made a small demo project that can help replicate this issue.
    Open up the project and press Test/GenerateWithASM to generate asmdef environment, or press Test/GenerateWithoutASM to generate without one.
    Then what I did is simply duplicate/delete TestBehaviour script which will cause the lag.

    UPDATE 1:

    Just after I finished writing this post I noticed a possible cause:
    If I delete every single .csproj + .sln from the project and try these tests then editor only hangs for
    ----- Total AssetImport time: 1.129635s (instead of 34.915822s)
    with 1700 files / 50 asmdef using VS.

    So I guess this issues is somehow related to these files.
     

    Attached Files:

    Last edited: May 6, 2018
  48. lukaszunity

    lukaszunity

    Administrator

    Joined:
    Jun 11, 2014
    Posts:
    461
    Could you report bugs on the issues you are experiencing with repro projects and share the case numbers here?

    This allows us to easier track the issues, give them visibility and prioritize fixing them.
     
  49. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,051
    Have you read my issue posted above Lukasz?

    @sailro said that it's an issue on Unity end.

    Thanks.
     
  50. FastKillteam1

    FastKillteam1

    Joined:
    Sep 20, 2017
    Posts:
    50
    A workaround is to go into vs, file - move “nameofscript” into - “name of project”