[SOLVED]2 Empty errors in console - "& was unexpected at this time."

Hi everyone,

WHAT IS THE ISSUE ?
My issue is that I get an empty error in console

In Editor Log i’ve found this issue :
“C:\Program Files\Unity\Hub\Editor\2019.3.0f3\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\VertexModifiers\Shadow.cs”

-----CompilerOutput:-stdout–exitcode: 1–compilationhadfailure: True–outfile: Temp/UnityEngine.UI.dll
-----CompilerOutput:-stderr----------
& was unexpected at this time.
-----EndCompilerOutput---------------

  • Finished script compilation in 0.087442 seconds

When i open the C# Solution in Visual studio and try to build the solution i got exactly same two errors

WHEN THE ISSUE OCCURS ?
Every time I open a project i get these two errors and i’m unable to run the game.
I’ve tried several unity version and the error is the same in all of them

EDIT:
After uninstalling all of the Unity and Visual Studio version and clean new install, the issue does not occure on “Unity 2018.4.14f1 (64-bit)”

I have .NET 4.5.1 installed

5313138--534132--upload_2019-12-24_22-41-28.png

I have all the latest updates for windows - even optional ones, and I am running Windows 10.
This was not an issue for me till now. Now it happens all the time for all projects. Even if i create brand new Project without any script in it i get these two errors.

WHAT I’VE TRIED ?

  • New unity versions
  • Updating Visual Studio
  • Repairing Visual Studio
  • Trying to force ‘re-compile’ by slightly changing the script
  • Re-importing all the assets
  • “.exe” or Full path FIX added to unity_csc.bat (not valid on the latest version which already contains .exe extension)
  • I’ve checked my local time region and its set to English (United States)

Can someone please help me or point me somewhere ? Would be much appreciated ! Thanks !
And also - MERRY CHRISTMAS ! :slight_smile:

Bump + new info. I’ve found out that when i simply run cmd.exe i get exactly same error. Also, it doesnt matter how much i change unity_csc.bat file - I can add totally invalid code there and the result is still the same

5314497--534330--upload_2019-12-25_18-24-15.png

Also, when i compile in MS VS 2017 i get the same error
but when i compile same solution in MS VS 2019 the compilation is successful

So the cause of the issue was faulty Autorun registry record which i had to erase and now i get no errors ! Details of this fix can be found at powershell - cmd.exe throws error "& was unexpected at this time." - Stack Overflow

1 Like

My own googling (I had the same problem) shows that some malware uses the Autorun registry record. That could be where it came from, and would explain why I started seeing the issue suddenly. If it was malware, Windows Defender didn’t detect it, and I just had to delete Autorun before looking at what was in it for insight.

ETA: in the stack overflow post, I see a reference to SoundMixer.exe. That’s a known malware (a bitcoin mining bot). Should probably delete it as well.