6

I've upgrade to the most recent Unity build (Unity 2019.3.0a7) and I'm getting a ton of errors, all the same, across different files.

My friends who I'm collaborating with are also running the same version, but don't have the errors.

There are two of them, each referencing different packages, but both referencing multiple errors inside each of the packages.

The errors are along the lines of:

(R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

error CS1504: Source file 'D:\[...]\[UnityProject]\Library\PackageCache\[email protected]\UnityEngine.TestRunner\NUnitExtensions\Commands\BeforeAfterTestCommandState.cs' could not be opened -- The type initializer for 'Microsoft.CodeAnalysis.Text.EncodedStringText' threw an exception.

And

Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
Copyright (C) Microsoft Corporation. All rights reserved.

error CS1504: Source file 'C:\Program Files\Unity\Hub\Editor\2019.3.0a7\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\EventSystem\UIBehaviour.cs' could not be opened -- The type initializer for 'Microsoft.CodeAnalysis.Text.EncodedStringText' threw an exception.

Theres about 15-20 of these errors reported in the respective error logs in the console, but all say the same thing (same error code) regarding threw an exception.

I've never seen this error before, and I can't find any assistance online with it. All my packages are fully up to date. I'm at a loss.

I'd really appreciate any suggestions on how to fix this.

3
  • 1
    Why are you guys using the alpha (aka if it didnt eat your children you should be celebrating) version. You dont normally see visual c# errors like that. as the unity compilation is done inside the unity ide. So, Id say delete the package and redownload it Commented Jul 6, 2019 at 11:30
  • 1
    As BugFinder already said .. don't use the alpha or beta versions except for trying out new features. They are not stable for production! Stick to the latest stable release version wich currently is 2019.1.8f1 (make Backups before switching versions) Since the first error referes to the Library folder you might want to completely reset the project folder. In this answer I explained how. Commented Jul 6, 2019 at 14:00
  • I have no idea....they insisted we use Alpha for some reason (I was hesitant, but didn't care as long as it worked - which clearly it doesn't. Time to try convince them to downgrade in the name of sanity, otherwise I guess I won't be collaborating :L :) Commented Jul 6, 2019 at 16:10

2 Answers 2

16

Uninstalling Anaconda and Python can result in such issues because of remaining artifacts in the Windows registry.

In my case, removing the following key in Registry Editor worked :

Computer\HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

It was targeting a file removed in the Anaconda uninstall process.

Sign up to request clarification or add additional context in comments.

1 Comment

Seeing this, I decided to not uninstall my Anaconda and just remove the key in Regedit, and it started to work. Looks like it's the only source of this type of issue. I'm using Unity version 2020.3.5f1.
7
  • Close Unity
  • Remove the Library folder
  • Reopen the project in Unity and wait for Unity to reimport the project

It should work. If it doesn't then probably your Unity version has some bugs.

3 Comments

Sadly nothing is working. Thanks though. I've just resolved myself to downgrade (upgrade?) to the latest stable version of Unity
This did not help, and weirdly the version 2019.3.0f3 worked fine a few days ago but I'm stuck with this microsoft error that won't let me compile. Erg. I tried updateing Visual Studio Community just in case the C# compiler was broken,
^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 superuser.com/questions/727316/… For me, deleting the registry value for "HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun" fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.