Roslyn csc errors in log and two blank console errors

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).

5224511--520790--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:

-----CompilerOutput:-stdout--exitcode: 9009--compilationhadfailure: True--outfile: Temp/UnityEngine.UI.dll
-----CompilerOutput:-stderr----------
'"D:\Programs\Unity-IDE\2019.2.14f1\Editor\Data\Tools\RoslynScripts\..\..\Tools\Roslyn\csc"' is not recognized as an internal or external command,
operable program or batch file.
-----EndCompilerOutput---------------
- 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

1 Like

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

OK – looks like I’ve made progress (soon as I posted in here). :eyes:

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

// WildStyle

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.

1 Like

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

Lost 24 hours of development time though… cries

Glad you got it fixed too @Totoro83y !

// WildStyle

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… :face_with_spiral_eyes:

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

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”?

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

Perhaps worth noting the same issue was also happening with other test projects, even a new project too.

// WildStyle

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.

1 Like

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.

1 Like

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.

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.

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.

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.

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

Same issues here. Bug reports:
Hub: Case 1201958
Editor: Case 1201959

1 Like

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: “:\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 @ for the solution.

13 Likes

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.