Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Roslyn csc errors in log and two blank console errors.

Discussion in 'Windows' started by WildStyle69, Nov 28, 2019.

  1. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Been developing my project on Windows 10 for a long time with no major issues. Then out of nowhere this week it starts, now every time I open my project there are two blank errors at the console that I cannot clear (see image below).

    2019-11-29_00h50_25.png

    • I'm running Unity 2019.2.14f1, and also tried going back to 2019.2.13f1 and 2019.2.12f1 but the problem persists.
    • I use git source control, so even if I roll back a few days to a commit where I'm sure all was working fine, the same error persists.
    • Tried removing Unity and reinstalling, didn't help.
    • Removed the 'Library' and did a clean import, didn't make any difference either.

    Error in the editor log says:

    Code (CSharp):
    1. -----CompilerOutput:-stdout--exitcode: 9009--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
    2. -----CompilerOutput:-stderr----------
    3. '"D:\Programs\Unity-IDE\2019.2.14f1\Editor\Data\Tools\RoslynScripts\..\..\Tools\Roslyn\csc"' is not recognized as an internal or external command,
    4. operable program or batch file.
    5. -----EndCompilerOutput---------------
    6. - Finished compile Library/ScriptAssemblies/UnityEngine.UI.dll
    If I copy the path to a command windows it works just fine, and finds the csc.exe OK.

    So at the moment I'm completely stuck, cannot do anything until I get this resolved.

    Can anyone please help or have any suggestion?

    // WildStyle
     
    HitGrab1 likes this.
  2. Totoro83y

    Totoro83y

    Joined:
    Sep 21, 2013
    Posts:
    21
    I'm having the same problem just now.

    Like @WildStyle69 I tried to roll some version back, to restore Unity 2019.2.12, nothing seems to change
     
  3. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    OK -- looks like I've made progress (soon as I posted in here). o_O

    Uninstalled Unity Hub and launched my project in Unity from the command line / directly, the errors are gone!

    // WildStyle
     
  4. Totoro83y

    Totoro83y

    Joined:
    Sep 21, 2013
    Posts:
    21
    I uninstalled unity hub and started the editor from the windows shell, and the problem disappeared for me too. It seems a bug with the hub, and I wasn't aware of it because I updated unity and the hub together.
     
    WildStyle69 likes this.
  5. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Now reinstalled Unity Hub again and it's working... that's pretty messed up, but I'm not complaining.

    Might have been caused by a Unity Hub upgrade I think, when it auto-installs over the top of an existing installation.

    // WildStyle
     
  6. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Lost 24 hours of development time though... *cries*

    Glad you got it fixed too @Totoro83y !

    // WildStyle
     
  7. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Wow - second time I opened my project after reinstalling Unity Hub the error came back again, however only one this time. I have a feeling that would not be the end of it though... :confused:

    I've removed Unity Hub for now and am opening my project in Unity from the command line / directly, lost too much time to this issue already.

    // WildStyle
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,737
    What makes you believe this has anything to do with the hub? Does this file exist? "D:\Programs\Unity-IDE\2019.2.14f1\Editor\Data\Tools\Roslyn\csc"?
     
  9. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Thanks for response -- did you actually read my full post and responses before replying?
    • "If I copy the path to a command windows it works just fine, and finds the csc.exe OK."
    • "Uninstalled Unity Hub and launched my project in Unity from the command line / directly, the errors are gone!"
    • "Now reinstalled Unity Hub again and it's working... that's pretty messed up, but I'm not complaining."
    • "Wow - second time I opened my project after reinstalling Unity Hub the error came back again, however only one this time. I have a feeling that would not be the end of it though..."
    So at the moment if I install Unity Hub and try to launch from that, the issue comes back. If I launch the project directly without Unity Hub it works (every time).

    // WildStyle
     
  10. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    Perhaps worth noting the same issue was also happening with other test projects, even a new project too.

    // WildStyle
     
  11. gamebei

    gamebei

    Joined:
    Nov 29, 2019
    Posts:
    1
    I encountered exactly the same issue.
    Thanks for this post for saving my day!

    I was using UnityHub 2.1.3 at the first place,
    and when I clicked the "upgrade" button on the footer bar in UnityHub,
    I have two versions of UnityHub(2.1.3 and 2.2.0) installed at the same time.

    And when I open my project by Unity2019.2.2f1, I got the same blank errors.

    Just like what WildStyle69 said, uninstalling UnityHub get those errors fixed.
     
    Last edited: Nov 29, 2019
    WildStyle69 likes this.
  12. barodapride

    barodapride

    Joined:
    May 4, 2017
    Posts:
    5
    The exact same issue happened to me and I was also able to resolve it the same way:
    1. Uninstall Unity Hub
    2. Start Unity manually and open the project - the errors are gone
    3. Reinstall Unity Hub and everything is fine now

    Simply reinstalling Unity Hub did not fix the issue - I had to open the project in Unity manually.
     
    Malkyne likes this.
  13. barodapride

    barodapride

    Joined:
    May 4, 2017
    Posts:
    5
    Just a mini update - after fixing the issue, I was working on my project again and suddenly the issue re-appeared! Some extra information - when I go to add or remove programs I see two Unity Hub versions there - but I can only uninstall one. Not sure if that has any relevance but it seems the issue will come back after some time.
     
  14. Totoro83y

    Totoro83y

    Joined:
    Sep 21, 2013
    Posts:
    21
    The same for me. I removed it directly from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    Reinstalled unity hub and now it's working, I'll tell you if I get the error again as you had.
     
  15. Totoro83y

    Totoro83y

    Joined:
    Sep 21, 2013
    Posts:
    21
    I received the same error again after a simple git revert, and even restarting unity didn't make them disappear.
    Uninstalled hub again and now all works again.
     
  16. JennyHide

    JennyHide

    Joined:
    Sep 30, 2014
    Posts:
    47
    Same here - I've been getting the same error since updating the Hub, and when I check, the file does exist. Uninstalling and reinstalling the Hub didn't help, but downloading a version of the Unity Editor without the Hub does.
     
  17. afshinity

    afshinity

    Unity Technologies

    Joined:
    Jul 31, 2017
    Posts:
    334
    Hi everyone,

    Sorry for the inconvenience. I am wondering if anyone can report the bug using the hub bug reporter, then we can see why this issue is happening by looking into the editor and hub logs.

    Thanks,
    Afshin
     
  18. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    Same issues here. Bug reports:
    Hub: Case 1201958
    Editor: Case 1201959
     
    WildStyle69 likes this.
  19. admoraguilar

    admoraguilar

    Joined:
    Sep 13, 2019
    Posts:
    9
    Hey everyone,

    I've also encountered this error, and spent days figuring out what was wrong.
    This is the solution that worked for me without uninstalling or doing funky stuff with the Unity Hub.

    1. Go to this path: "<yourdiskletter>:\Program Files\Unity\2019.2.13f1\Editor\Data\Tools\RoslynScripts"
    2. Open the batch file inside with notepad.
    3. From there find the string similar to this: "%APPLICATION_CONTENTS%\Tools\Roslyn\csc"
    4. Put a ".exe" after the "\csc" part of the string.
    5. Restart Unity if you have it opened.

    All thanks to @adrisj7 for the solution.
    https://answers.unity.com/questions/1680858/blank-console-error-on-empty-project-with-a-single.html
     
    BoBeR2, Ultraspider, abegue and 10 others like this.
  20. ashapcott

    ashapcott

    Joined:
    Apr 4, 2019
    Posts:
    27
    Started to encounter the same problem yesterday immediately after updating the Unity Hub. Blank errors even on brand new projects with "C:\Program Files\...\Tools\Roslyn\csc" not being recognized in the Unity Editor.log file. Ended up fully reinstalling VS2017, Unity Hub (2.2.1), and Unity (2019.2.0b7, 2019.2.14f1) and still kept encountering the same problem.

    Ultimately wateeeeeeeer's solution seems to have worked for me.
     
  21. HiddenTess

    HiddenTess

    Joined:
    Jan 7, 2016
    Posts:
    21
    I've been banging my head on this for probably 10 hours now, and you all have saved me!

    I used the adrisj7 Unity Answers solution, as posted by wateeeeeeeer, and this fixed my problem.

    Thank you, everyone, for sharing your struggles, and helping each other out. You are champions.
     
  22. Mihroh

    Mihroh

    Joined:
    Nov 27, 2014
    Posts:
    1
    Same here! It took quite a while until I found the csc call in the Editor log, which led me to this page.
    I wish this post was the first I found when trying to google the issue :)

    Thanks everyone, now I can get back to doing fun things :D
     
    HiddenTess and tigerss like this.
  23. tigerss

    tigerss

    Joined:
    Oct 11, 2015
    Posts:
    20
    Thank you! I can confirm this was also my problem!
     
    abegue and ToniGalmes like this.
  24. UnityTester33

    UnityTester33

    Joined:
    Dec 17, 2016
    Posts:
    7
    That works for me as well. U2019.2.11f1+W10
     
  25. owiewestside

    owiewestside

    Joined:
    Dec 6, 2019
    Posts:
    1
    I just want to let people coming here know that the issue is known and is being tracked here:
    https://issuetracker.unity3d.com/is...le-is-overriden-in-user-environment-variables

    The answer of updating unity_csc.bat given above seems to work for now (at least it worked for me, you may need to trigger a recompile by changing/editing a script in your project before the error disappears).

    The bug in the above link seems to suggest this is because of %PATHEXT% environment variable being set erroneously in someway.
     
  26. sindrijo

    sindrijo

    Joined:
    Mar 11, 2014
    Posts:
    13
    I've also had this issue and adding the ".exe" to the invocation of 'csc' in bat file but now my logs in the editor look different and include the "wrong" stack information:

    Code (CSharp):
    1.  
    2. YOURLOGMESSAGE
    3. 0x00007FF7A4C43FBC (Unity) StackWalker::GetCurrentCallstack
    4. 0x00007FF7A4C47491 (Unity) StackWalker::ShowCallstack
    5. 0x00007FF7A34D5B15 (Unity) GetStacktrace
    6. 0x00007FF7A57FBF0B (Unity) DebugStringToFile
    7. 0x00007FF7A4C78444 (Unity) DebugLogHandler_CUSTOM_Internal_Log
    8. 0x0000026D163EE59B (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
    9. 0x0000026D163EE1CB (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    10. 0x0000026D163EDB68 (Mono JIT Code) [Logger.cs:139] UnityEngine.Logger:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
    11. 0x0000026D163ED2B2 (Mono JIT Code) [Debug.bindings.cs:172] UnityEngine.Debug:LogWarningFormat (UnityEngine.Object,string,object[])
    12. 0x0000026D163E227B (Mono JIT Code) [ResourceProvider.cs:525] Core.ResourceProvider/ResourceDependencyDiscoverer:DiscoverDependenciesEditor ()
    13. 0x0000026D1D798C15 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
    14. 0x00007FFCAE55BFB0 (mono-2.0-bdwgc) [mini-runtime.c:2809] mono_jit_runtime_invoke
    15. 0x00007FFCAE4E2142 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke
    16. 0x00007FFCAE4EB13F (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke
    17. 0x00007FF7A4BCE1E2 (Unity) scripting_method_invoke
    18. 0x00007FF7A4BC7E91 (Unity) ScriptingInvocation::Invoke
    19. 0x00007FF7A4B94630 (Unity) MonoManager::SetupLoadedEditorAssemblies
    20. 0x00007FF7A4B85B4C (Unity) MonoManager::EndReloadAssembly
    21. 0x00007FF7A4B90F09 (Unity) MonoManager::ReloadAssembly
    22. 0x00007FF7A31CB973 (Unity) ReloadAllUsedAssemblies
    23. 0x00007FF7A35EEACC (Unity) AssetInterface::ReloadDomainIfNecesary
    24. 0x00007FF7A35E94F7 (Unity) AssetInterface::ProcessAssetsImplementation
    25. 0x00007FF7A35F46DD (Unity) AssetInterface::StopAssetEditing
    26. 0x00007FF7A35EE12E (Unity) AssetInterface::RefreshInternal
    27. 0x00007FF7A35EB108 (Unity) AssetInterface::Refresh
    28. 0x00007FF7A3578080 (Unity) AssetDatabase::Refresh
    29. 0x00007FF7A2C2D7DA (Unity) Application::AutoRefresh
    30. 0x00007FF7A34E6BE3 (Unity) ContainerWindow::ContainerWndProc
    31. 0x00007FFD2EAE63ED (USER32) CallWindowProcW
    32. 0x00007FFD2EAE5FBC (USER32) DispatchMessageW
    33. 0x00007FFD2EAF2753 (USER32) IsWindowVisible
    34. 0x00007FFD3071FE14 (ntdll) KiUserCallbackDispatcher
    35. 0x00007FFD2DBB10C4 (win32u) NtUserPeekMessage
    36. 0x00007FFD2EAE9CC2 (USER32) PeekMessageW
    37. 0x00007FFD2EAEA2B9 (USER32) PeekMessageA
    38. 0x00007FF7A34DCEDE (Unity) MainMessageLoop
    39. 0x00007FF7A34DFA4F (Unity) WinMain
    40. 0x00007FF7A6196B02 (Unity) __scrt_common_main_seh
    41. 0x00007FFD2E747BD4 (KERNEL32) BaseThreadInitThunk
    42. 0x00007FFD306ECED1 (ntdll) RtlUserThreadStart
     
  27. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,737
    That stack looks correct. Anyway, this is related to stacktrace setting in the console and has nothing to do with editing that .bat file.
     
  28. sindrijo

    sindrijo

    Joined:
    Mar 11, 2014
    Posts:
    13
    Aha! Right, I found it. Thanks! StackTraceLogSetting.PNG
     
  29. sgt_pepp

    sgt_pepp

    Joined:
    Mar 7, 2019
    Posts:
    1
    Hi all, for macOS? Thanks.
     
    maxmartinezruts_unity likes this.
  30. BoBeR2

    BoBeR2

    Joined:
    Apr 19, 2020
    Posts:
    1
    I had same error unity version: 2019.3.9f1
    Path was correct, but it wasn't .NETCore dlls in the folder with csc.exe (Editor\Data\Tools\Roslyn). After add them issue was resolved.
     
  31. jesusk

    jesusk

    Joined:
    Aug 30, 2014
    Posts:
    1
    Could you explain how you did it?
     
  32. Deleted User

    Deleted User

    Guest

    Hello,

    I am still encountering the same problem. I am new to Unity, actually it's my first project and the problem that i am facing is everytime I try to open unity editor, it opens with two identical errors showing that

    .......\Data\Tools\Roslyn\csc.exe
    The requested operation requires elevation.

    What do I do? It doesn't ask me for an administrator permission. I am also not able to edit the batch file where it wants 'permission to open the file.' But I am the owner and adminstrator, why don't I have the permission? It already has the '.exe' present as in the error message, yet I look if I could modify to csc and then revert back csc.exe. But no allowed. Please Help.
     
  33. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,737
    Can you open the "properties" of that .exe file, go to "Compatibility" tab and show a screenshot of that? Also, go to Security tab, click :"Advanced" and show a screenshot of that too.
     
  34. TrioTopGear

    TrioTopGear

    Joined:
    Feb 5, 2018
    Posts:
    1
    Hi
    I tried everything but these 2 blank errors are not removing. I am using Unity 2019.2.21 and other unity versions working fine. Pls help.
     

    Attached Files:

  35. yoelmarcylcapala

    yoelmarcylcapala

    Joined:
    Nov 17, 2020
    Posts:
    1
    I tried deleting unity_csc and it gave two same errors but different but when I tried playmode, it works
     
  36. Sneh_Raval_DevTeam

    Sneh_Raval_DevTeam

    Joined:
    Dec 28, 2018
    Posts:
    5
    I have faced the same issues with Unity Hub 2.4.2 version and Unity Unity 2019.4.13f1 LTS version.
    The solution which has worked for me is that uninstalled Hub and download Unity from archives (https://unity3d.com/unity/qa/lts-releases).
     
  37. kazimdraiyan2006

    kazimdraiyan2006

    Joined:
    Dec 19, 2020
    Posts:
    1
    it didn't work for me :(
     
  38. Deleted User

    Deleted User

    Guest

    Sadly none of these tricks work. UnityHub is a mess (trash Electron apps) - New or old projects are completely unusable due to every start up complains about errors, 2 blank errors and everything is broken no matter what you do.
     
  39. jessekcooley

    jessekcooley

    Joined:
    Feb 7, 2019
    Posts:
    9
    Hi, still having this error in 2022. Things that I have tried that have not worked:
    uninstalling hub and running from editor.
    uninstalling all unity versions and reinstalling.
    editing Roslyn script.
    deleting Roslyn script.
    updating Windows.
    For some reason this error has triggered a snowball of compilation issues that make almost every script in my game lose reference to every other script in my game so diagnosing in VS is next-to-impossible.
     
  40. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,737
    Random suggestion: can you check if cmd.exe is functional on your machine? We've found that Unity breaks down if it's not.
     
  41. ReaktorDave

    ReaktorDave

    Joined:
    May 8, 2014
    Posts:
    139
    Had the same issue as OP but on Manjaro/Gnome with Unity 2020.3.28. Uninstalling Unity Hub and opening Unity directly didn't fix the issue. I then installed Unity via FlatHub instead of AUR. Launching projects from the FlatHub Unity Hub fixes the problem (but makes some UI elements not respect dark mode, which was the case with Unity launched from AUR Unity Hub).

    EDIT:
    A better solution is to use UnityHub from the AUR and instead add the following line to the .profile and .zprofile:

    export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1


    This fixes the compile issue of Unity's UI library for all projects. It also makes all of Unity's UI elements respect dark mode and it also fixes the problem that Unity will hang when trying to exit (although that isn't part of OP's problem).
     
    Last edited: Sep 2, 2022