IL2CPP error - Failed to resolve assembly: 'netstandard, Version=2.0.0.0...'

I am using the cloud build of Unity and try to do a WebGL build and get the following error message:

I’m having a really hard time trying to figure out which assembly is responsible for the error so that I can solve the problem. I will be glad to receive any help.

Can you build this project locally? Can you build an empty project locally?

This almost most looks like some Unity installation issue, but I would not expect that on a cloud build.

Hey Josh, thank you for your response.

Building the Project for WebGL locally throws the exact same exception.
Building an empty Project for WebGL works locally.
Building the Project for other Platforms (Windows, Linux, Mac) works on both, Cloud Build and locally.

Ok, a few more questions then:

Is there some assembly in the project that is built against .NET Standard 2.0?

What is the Scripting Backend setting for these platforms (in the Player Settings)? Is it Mono or IL2CPP?

There are multiple assemblies that are built against net standard 2.0.3 and Scripting Backend is Mono.

Thanks for the details.

First of all, this error will only happen with IL2CPP, so that is likely why on WebGL fails, as it uses IL2CPP.

Send, what is the Api Compatibility Level setting in the Player Settings? I believe it needs to be .Net Standard 2.0 in order for assemblies built against .Net Standard 2.0 to work properly.

1 Like

For any reason it’s the opposite, when building with Api Compatibility Level .NET Standard 2.0 the error is thrown, building with .Net 4.x works.

That is odd. Is this a project that you can submit with a bug report?

How do I do that? Do I have to upload the project somewhere?

You can follow these instructions to report a bug: https://unity3d.com/unity/qa/bug-reporting

Hi, Was this resolved? Any insights would be appreciated. If I run on Mondo/Arm7 it builds fine. Running IL2CPP/ARM64 I get similar error.

My specific error is: “Failed to resolve assembly: 'Unity.RuntimeSceneSerialization, Version=0.0.0.0…”

I should add:

  • I am using the preview package UI Builder
  • I am using MARS/AR foundations so I need IL2CPP/ARM64

Thank you!

Can you provide the full call stack you get with this error? It looks like this might be a different issue.

I wondered if that was the case. Please see below and let me know if you would like me to open another thread. Appreciate the help!

Exception: Failed running D:\UnityEditors\2020.3.0f1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @D:/XR/WanderingStar/Temp/StagingArea/assets/bin/Data/Managed/response.rsp

stdout:
Fatal error in Unity CIL Linker
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: ‘Unity.RuntimeSceneSerialization, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’
at Unity.Linker.EngineStripping.EngineModule.ResolvedReferences(UnityLinkContext context)+MoveNext()
at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModuleReferences(EngineModule module, Boolean markEngineModule)
at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModule(EngineModule module, Boolean markEngineModule)
at Unity.Linker.Steps.Marking.EngineStrippingMarking.MarkModuleOf(IMemberDefinition member)
at Unity.Linker.Steps.Marking.EngineStrippingMarking.DoAdditionalFieldProcessing(FieldDefinition field)
at Unity.Linker.Steps.UnityMarkStep.DoAdditionalFieldProcessing(FieldDefinition field)
at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField(FieldReference reference)
at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField(FieldReference reference)
at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields(TypeDefinition type)
at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing(TypeDefinition type)
at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
at Mono.Linker.Steps.MarkStep.MarkField(FieldReference reference)
at Unity.Linker.Steps.UnityMarkStep.Unity.Linker.Steps.Marking.IMarkStepCallbacks.MarkField(FieldReference reference)
at Unity.Linker.Steps.Marking.BaseMarkStepExtension.MarkField(FieldReference reference)
at Unity.Linker.Steps.Marking.MonoBehaviourMarking.MarkNeededFields(TypeDefinition type)
at Unity.Linker.Steps.Marking.MonoBehaviourMarking.DoAdditionalTypeProcessing(TypeDefinition type)
at Unity.Linker.Steps.UnityMarkStep.DoAdditionalTypeProcessing(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkField(FieldDefinition field)
at Mono.Linker.Steps.MarkStep.MarkEntireType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.MarkEntireAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Unity.Linker.Steps.UnityMarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Unity.Linker.Steps.UnityMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Unity.Linker.UnityDriver.UnityRun(ILogger customLogger)
at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger)
at Unity.Linker.UnityDriver.RunDriver()
stderr:

UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action1[T] setupStartInfo) (at <50f55621a2ca4f31a35283e2979a8bf5>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <50f55621a2ca4f31a35283e2979a8bf5>:0) UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <50f55621a2ca4f31a35283e2979a8bf5>:0) UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <50f55621a2ca4f31a35283e2979a8bf5>:0) UnityEditorInternal.IL2CPPBuilder.Run () (at <50f55621a2ca4f31a35283e2979a8bf5>:0) UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <2c6e9a95f1dd4e06ad71afcd2684dcb7>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <50f55621a2ca4f31a35283e2979a8bf5>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Yes, this looks like a different issue. Can you start a new thread?

Done. Here is the link if anyone else had the same issue as mine:

Thank you!

1 Like

Re: the original issue with the “Failed to resolve assembly: ‘netstandard, Version=2.0.0.0…’” error, I was able to resolve this by adding a link.xml file to my Assets folder with this:

<linker>
    <assembly fullname="netstandard" preserve="all"/>
</linker>
7 Likes

I seemed to have resolved the error by using .Net 4.x and Mono as well

Thank you for this.

For future devs trying to figure this out, the error I got was:
unity (0,0): error Mono.Cecil.ResolutionException: Failed to resolve System.Text.RegularExpressions.RegexOptions

Removing the MARS preview packages fixed it.