I just downloaded Unity 2021.3.16f1 URP and created a new project. Whilst creating it, a prompt came up and asked me to go into safe mode. The following errors occurred:
Library\PackageCache\com.unity.burst@1.8.2\Runtime\SharedStatic.cs(35,28): error CS0103: The name ‘Unsafe’ does not exist in the current context
Library\PackageCache\com.unity.burst@1.8.2\Runtime\BurstString.Float.cs(1442,21): error CS0103: The name ‘Unsafe’ does not exist in the current context
Library\PackageCache\com.unity.burst@1.8.2\Runtime\BurstString.Float.cs(1469,21): error CS0103: The name ‘Unsafe’ does not exist in the current context
Library\PackageCache\com.unity.burst@1.8.2\Runtime\BurstString.Float.cs(1594,17): error CS0103: The name ‘Unsafe’ does not exist in the current context
Library\PackageCache\com.unity.burst@1.8.2\Runtime\BurstString.Float.cs(1651,17): error CS0103: The name ‘Unsafe’ does not exist in the current context
I don’t think the fault is with the package directly. I had to rollback my Windows 10 to a previous version due to graphics driver failure. I had Unity 2021.3.16f1 installed and rollbacked to a point where I had only 2021.3.11f installed. I think it’s a Windows registry error or something is cached.
Installed 2021.3.15f1 and created a new 3D URP Core project. The above errors are gone. The project works normally.
However, when downgrading my existing project from 2021.3.16f1 to 2021.3.15f1 there are some errors. Would have been good if I had a backup right now. Will try to fix it. If it doesn’t work I’ll just make a new project and import all of my assets.
I’m still trying to fix the project. I tried making a new project and copied all assets but all my presets are gone and the errors persist. I’m currently getting this error when running the game in the editor:
Which leads to DiagnosticReport.StartReport();
I assume I need to reload the OpenXR plugin somehow. I tried to rebuild the solution from Visual Studio but the error is still present.
Unity caches packages in “C:\Users\User\AppData\Local\Unity\cache\packages\packages.unity.com”
I deleted the folder “com.unity.xr.openxr@1.5.3” which was 20.2MB at the time.
After I went back into Unity, a new folder with the same name was created with a new size of 28.4MB. Which means the error was with the cached instance of the package.
With this new instance, I restarted Unity and I could run the game without errors. Even my HMD connection works now.
I got the same error with Unity 2022.2.2f1. Even I deleted package cache from users folder and project library folder, I still get this error. How can I fix this?
It looks like Unity has iterated on C# in 2222.2 such that Unsafe dll support that previously worked no longer does. However it appears that a newer version of Unsafe should be used instead.
If you’re like me and not interested in dealing with nuget, rename the .nuget download to .zip, unzip it, and move lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll into your Assets dir.
I am using unity 2022.3.6f1 and whenever i tried to open a 3D URP project is asks to enable to safe mode and pops up with too many errors how can i fix that i tried to find solution but can’t find nay please help…