com.unity.pipeline 0.5.0-exp.1 and 0.6.0-exp.1 both include an old System.Runtime.CompilerServices.Unsafe.dll (assembly version 4.0.4.0).
After upgrading Unity from 6000.3.11f1 to 6000.3.23f1, Collections was updated from 2.6.2 to 2.6.8. Collections 2.6.8 removed its copy of Unsafe.dll to avoid duplicate assemblies, so Unity now loads the older copy from Pipeline. This causes ZLinq to fail at runtime with:
MissingMethodException: Method not found: void System.Runtime.CompilerServices.Unsafe.SkipInit<T>(T&)
Pinning Collections to 2.6.2 works around the issue.
Since Collections no longer bundles this dependency, could Pipeline also remove it if it is not required? If it is required, could it be updated to a current compatible version or isolated so it does not override the project’s version?
This problem has happened once with the AI Assistant package. I don’t understand why they let it happens again.
We are looking at fixing this issue.
It is true that the old collection package uses System.Runtime.CompilerServices.Unsafe.dll while the new version of the package doesn’t.
We will try to look at harmonizing the version across packages.
Thanks for the feedback.
Seb
Hi @kyubuns ,
I am trying to setup a project to repro your bug.
Here my dependencies in my project on Unity 6000.3.11f1:
I installed Zlinq using those instructions: GitHub - Cysharp/ZLinq: Zero allocation LINQ with LINQ to Span, LINQ to SIMD, and LINQ to Tree (FileSystem, JSON, GameObject, etc.) for all .NET platforms and Unity, Godot. · GitHub (NuGetForUnity + install from the package URL).
I opened the same project with Unity 6000.3.23f1 and some package updates were performed. And I don’t have any Zlinq errors:
Can you guide me on how your project is setup? Can you share a small project reproducing the bug?
Thanks,
Seb
Hey @kyubuns ,
I continued my investigation.
I started with a basic URP (which contains Collections and Burst) project with ZLinq all created with Unity 6000.3.11. I didn’t installed the Pipeline package.
I upgraded the project to 6000.3.23f1. And I got these errors:
It kinda seems that Zlinq was relying on the CompilerServices.Unsafe.dll coming from the Collections package to work? It seems the issue is not Pipeline specific.
@sebastienp_unity Thanks for looking into this!
I believe the error you observed and the one I reported are separate issues, so let me clarify the distinction.
1. The missing Unsafe.dll error
ZLinq 1.5.6 declares a dependency on System.Runtime.CompilerServices.Unsafe 6.1.2 or later. However, if an assembly with that name is already visible to Unity—for example, from Pipeline or Collections 2.6.2—NuGetForUnity treats it as already imported in engine and skips installing the dependency.
If that assembly later disappears, as happened when Collections 2.6.8 removed its copy, ZLinq remains installed but its Unsafe dependency is missing:
Unable to resolve reference 'System.Runtime.CompilerServices.Unsafe'
I confirmed that explicitly installing System.Runtime.CompilerServices.Unsafe 6.1.2 through NuGetForUnity resolves this error. So, as you said, Pipeline is not involved in this particular issue, and we can set it aside for this discussion.
2. The runtime error I originally reported
Sorry if my original explanation was unclear. This error occurs only when the affected ZLinq code runs; simply opening the project does not trigger it.
Please try the following setup without explicitly installing Unsafe through NuGetForUnity:
- Unity 6000.3.23f1
- Collections 2.6.8
- Pipeline 0.6.0-exp.1
- ZLinq 1.5.6
Then add this script and enter Play Mode:
using System;
using UnityEngine;
using ZLinq;
public static class ZLinqUnsafeRepro
{
[RuntimeInitializeOnLoadMethod]
private static void Run()
{
foreach (var value in new[] { 1 }.AsValueEnumerable()
.Zip(new[] { 2 }, ValueTuple.Create))
{
Debug.Log(value);
}
}
}
In my environment, this throws:
MissingMethodException: Method not found:
void System.Runtime.CompilerServices.Unsafe.SkipInit<!0>(!!0&)
Unity loads the System.Runtime.CompilerServices.Unsafe 4.0.4.0 bundled with Pipeline, which does not contain the Unsafe.SkipInit method required by ZLinq.
Before the upgrade, Unity 6000.3.11f1’s package set resolved Collections 2.6.2. That version bundled Unsafe 6.0.0.0, and Unity resolved ZLinq against that newer copy, so it worked. After the upgrade, Collections 2.6.8 removed its copy, causing Unity to load Pipeline’s older DLL instead.
3. Pipeline bundling an outdated Unsafe.dll
I therefore still believe it is a problem that Pipeline ships an outdated System.Runtime.CompilerServices.Unsafe.dll in a way that makes it visible across the project.
The same type of conflict was previously discussed for Collections:
- UPM DLLs being automatically referenced by all asmdefs
- Unsafe version mismatch and the embedded-package workaround
- Request to update Collections’ Unsafe reference
Following those discussions, Collections 0.11.0 removed Unsafe.dll. It was later included again as a precompiled test assembly, but Collections 2.6.8 removed it again specifically to avoid conflicts when the same DLL is present multiple times. Changelog | Collections | 2.6.8
Given this history, should Pipeline also stop bundling an outdated, globally visible copy?
Hi @kyubuns ,
Thanks for the thorough reporting and feedback. I will be addressing this bug today.
You are right that shipping dlls is not ideal. We are working on this.
Thanks for your patience, I will keep you in the loop.
Seb


