Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. 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

Error: Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)

Discussion in 'Scripting' started by LilyTheThunder, Jul 25, 2019.

  1. LilyTheThunder

    LilyTheThunder

    Joined:
    Dec 4, 2018
    Posts:
    4
    Hey,
    I'm getting this error (and only this error):
    "Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved."
    It's preventing me from pressing play, since all compiler errors must be fixed. Seemed like it broke out of nowhere, it was working fine before.
    I tried basically every solution I found online, including uninstalling/reinstalling Visual Studio and Unity, deleting the Library folder, deleting the solution and csproj files, installing the latest dotnet packages, rebooting of course, changing to a different Unity version. Nothing has worked for me.
    Any ideas?
     
    GregoryFenn likes this.
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    7,870
    Stab in the dark - could you try changing the script runtime version and/or the script backend (in Project Settings -> Player)?

    Definitely file a bug report with Unity if nothing else.
     
  3. LilyTheThunder

    LilyTheThunder

    Joined:
    Dec 4, 2018
    Posts:
    4
    So it's fixed now, but I don't know why. I changed to an earlier version of 2019 and changed branch doing a clean, had some errors in a package (Multiplayer HLAPI) so I updated that package to fix the errors, and the compiler error went away! Maybe forcing a package update does the trick? I've seen other threads mentioning package changes.
     
  4. LilyTheThunder

    LilyTheThunder

    Joined:
    Dec 4, 2018
    Posts:
    4
    Changed branch again and it's back...
     
  5. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    7,870
    My guess is that there's an actual compile error in the code where you see the issue, but there's a problem with the compiler just in terms of actually outputting the error. My next thought would be: Does ANY compiler error break your compiler (indicating your compiler is well and truly broken), or is it one specific, obscure compile error that causes this (indicating that you've stumbled upon a strange edge case of compilation)? If you start with your "no goofy errors" branch and insert an obvious syntax error, does it give you this same error message, or the syntax error you expect?
     
  6. LilyTheThunder

    LilyTheThunder

    Joined:
    Dec 4, 2018
    Posts:
    4
    SOLVED: it's a compiler error, had a function that takes a parameter MyFunction(in myStructParam), and when calling it I explicitly put the "in" keyword in front (localVar.MyFunction(in myLocalStruct). This gave the compiler error, but writing it like (localVar.MyFunction(myLocalStruct) without the "in" fixed the problem. What's weird is that I call this function some other place with the "in" and it's fine.
     
  7. fam2k

    fam2k

    Joined:
    Nov 14, 2019
    Posts:
    2
    Hi,

    Im having the same problem. I cannot compile any script since today, I am thinking if it's bounded to my Spyder for python installation (seen another post were people having this problem installed it recently too)

    The difference is even if I start a new project and create a new empty script (so I have guaranteed 0 compile errors), Im still getting the message. Any help pls?¿

    upload_2019-11-21_2-33-27.png
     
  8. CelestialCreations

    CelestialCreations

    Joined:
    Dec 14, 2019
    Posts:
    4
    I am having the same problem too, just starting a new script brings the error!!!!
     
  9. julienkay

    julienkay

    Joined:
    Nov 12, 2013
    Posts:
    47
    I also had this issue (only the error and nothing else in the console):
    "Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved."
    I'm on WIndows 8.1

    Keep in mind, that this error can becaused by many things, so the following workaround might not be applicable in all cases.

    For me, when I opened the Editor log it showed the following:
    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    -----CompilerOutput:-stderr----------
    The command "C:\Users\<username>\autorun.cmd" is either misspelled or could not be found.
    -----EndCompilerOutput---------------

    -----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/UnityEngine.TestRunner.dll
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    -----CompilerOutput:-stderr----------
    The command "C:\Users\<username>\autorun.cmd" is either misspelled or could not be found.
    -----EndCompilerOutput---------------


    So, Unity tries to access the file "C:\Users\<username>\autorun.cmd", which does not exist on my PC. The registry has that path set in the Autorun key in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor\. I have no idea why that is the case. So if it's he same thing for anyone else, you have 2 options.
    1.) delete the registry key. I didn't try that, because I want to avoid fiddling with the registry right now.
    2.) create an empty text file at the above location ("C:\Users\<username>\") and rename it to "autorun.cmd". I did that and with this dummy file, the dlls can be compiled and the error went away.
     
  10. GregoryFenn

    GregoryFenn

    Joined:
    Feb 13, 2018
    Posts:
    35
    This is still an issue in various versions of Unity including 2019.2 and 2019.3 (running on Windows 10, all Unity Editors and Windows OS version up to date).


    ^I might have solved my issue, maybe it will help others: I can't be sure but I might have fixed it like this: see this link and the solution to what I thought was an unrelated problem https://superuser.com/questions/727...ine-the-system-cannot-find-the-path-specified

    For me, deleting the registry value for "HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun" fixed it.
     
    Last edited: Jan 8, 2020
    Antoinezak, eXperion17 and Xavier78 like this.
  11. wildwolf98731

    wildwolf98731

    Joined:
    Mar 17, 2020
    Posts:
    3
    I do what you guys said,but i only fixed one of the two problem,i still have one more to go.I tried removing all my package,but it didn't work.
    stderr in editor.log seem to be very long,so i

    And by the way,i installed my Visual Studio 2019 first,then my unity from the offical website,but i've install the Visual Studio Tools For Unity.
    Before i open up my first script after i installed my Unity,there was a window that say i'm using .Net 4.7.1 ,but this project is using .Net 4.6.1 and if i'm going to change the project's setting or download the newer version of .Net Framework.But i've installed .Net 4.8 .I think this is because i created this project in Unity 5.6.5f and it's not compatible.Then i create a new project,but this problem ,just like what happens to other , goes on.

    sorry for poor english ,it's not my first language.




    ###3/18####
    I uninstalled the 2019.3.2.1f version,and install 2018 version,now this problem is fixed.
     

    Attached Files:

    Last edited: Mar 18, 2020
  12. wildweasel04

    wildweasel04

    Joined:
    Jan 28, 2020
    Posts:
    2
    i get the same error but mine is on all my projects, including one that i created and have not edited
     
  13. wildweasel04

    wildweasel04

    Joined:
    Jan 28, 2020
    Posts:
    2
    mine also shows no stderr in the log, the field is blank eg
    ----CompilerOutput:-stderr--------
    ----EndCompilerOutput----
     
  14. PaulProd2007

    PaulProd2007

    Joined:
    Mar 4, 2020
    Posts:
    2
    For me, everytime i make a new project without changing it one bit, it gives me two of those errors. I tried every fix here and it doesn't work
     
  15. PaulProd2007

    PaulProd2007

    Joined:
    Mar 4, 2020
    Posts:
    2
    Nevermind. Somehow it works now xD
     
  16. wechat_os_Qy03KiS1eKXTPnwDglcaiz_XA

    wechat_os_Qy03KiS1eKXTPnwDglcaiz_XA

    Joined:
    Apr 16, 2020
    Posts:
    1
    This link maybe helpful.
     
  17. oshrifogel

    oshrifogel

    Joined:
    May 11, 2020
    Posts:
    2
    im getting the same error but only in 2019.3 versions. i tried 4 diffrent versions of 2019.3 and the result is the same. and i cant run microgames because it avaible only for 2019.3.4 and above. i didnt find any useful solution on internet do someone know EXACLY what to do to solve this???
     
  18. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    I have been getting this error. On a clean windows 10 installation with nothing but Unity and some graphics software installed. Any unity 2019 version seems to shoot this error. A freshly created unity project also has the error. An old game I have been working on works. It is not using the HRDP or URP or LWRP, so I am assuming it may have something to do with the render pipelines? There is no additional info in the error. Just those 2 lines that everyone else has.

    I have reinstalled everything multiple times. I even came close to reinstalling windows and I might try that at some point, but at the moment I have no on-going unity projects so I am not that desperate yet.

    After reinstalling everything Unity sometimes works. When I edit a script in Visual studio, this error pops up and after that no projects work. New, old, none. It seems to break something within unity somehow.

    I will be working with Unreal come next fall and if this error does not go away somehow, I will not be coming back.

    EDIT:

    After checking the Editor logs, I found more details:

    -----CompilerOutput:-stdout--exitcode: -1073741795--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    -----CompilerOutput:-stderr----------
    -----EndCompilerOutput---------------
    - Finished compile Library/ScriptAssemblies/UnityEditor.TestRunner.dll in 3.342126 seconds
    - Finished script compilation in 7.040543 seconds
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    Rebooting unity shows a different error like this:

    -----CompilerOutput:-stdout--exitcode: -1073741795--compilationhadfailure: True--outfile: Temp/Unity.Timeline.Editor.dll
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    -----CompilerOutput:-stderr----------
    -----EndCompilerOutput---------------
    - Finished script compilation in 13.028738 seconds
    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    Any ideas?
     
    Last edited: Jun 22, 2020
unityunity