SDK Version
4.6.0
Unity Version
6000.3.15f1
Platform
Sentry Environment
Sentry SaaS (sentry.io)
Other Error Monitoring Solution
Yes
Steps to Reproduce
Description
After upgrading Sentry Unity SDK 4.5.0 -> 4.6.0, compiling any script that interacts with SentrySdk.Metrics (e.g., EmitCounter, EmitGauge) throws a CS0012 compilation error in the Unity Editor: error CS0012: The type 'ReadOnlySpan<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=null'.
This seems to be a regression caused by the recent assembly aliasing removal (PR #2726 / Issue #2717). While fixing IL2CPP issues, System.Memory.dll was left disabled for the Editor platform in its .meta file. Because SentrySdk.Metrics methods contain overloads/signatures that require ReadOnlySpan<>, the C# compiler fails to resolve the overload resolution candidates during Editor compilation, explicitly demanding System.Memory, Version=4.0.1.2.
Steps to Reproduce
- Install Sentry Unity SDK
4.6.0 in a Unity project, Packages\manifest.json:
{
"dependencies": {
...
"io.sentry.unity": "https://github.com/getsentry/unity.git#4.6.0",
...
}
}
- Create a custom
.asmdef that references io.sentry.unity.runtime.
- Create a C# script inside this assembly and call a metric method:
SentrySdk.Metrics.EmitCounter("test_counter", 1.0, new[] { new KeyValuePair<string, object>("key", "value") });
- Switch back to Unity to trigger compilation.
Environment
- Sentry Unity SDK Version: 4.6.0
- API Compatibility Level: .NET Standard 2.1
- Platform: Unity Editor (Windows)
- Unity: 6000.3.15f1 (c1aa84e375f6)
Expected vs Actual Result
Expected Behavior
The code should compile successfully in the Editor, just as it did in 4.5.0.
Actual Behavior
The Unity console throws the following compilation error: error CS0012: The type 'ReadOnlySpan<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=null'.
SDK Version
4.6.0
Unity Version
6000.3.15f1
Platform
Sentry Environment
Sentry SaaS (sentry.io)
Other Error Monitoring Solution
Yes
Steps to Reproduce
Description
After upgrading Sentry Unity SDK
4.5.0->4.6.0, compiling any script that interacts withSentrySdk.Metrics(e.g.,EmitCounter,EmitGauge) throws a CS0012 compilation error in the Unity Editor:error CS0012: The type 'ReadOnlySpan<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=null'.This seems to be a regression caused by the recent assembly aliasing removal (PR #2726 / Issue #2717). While fixing IL2CPP issues,
System.Memory.dllwas left disabled for theEditorplatform in its.metafile. BecauseSentrySdk.Metricsmethods contain overloads/signatures that requireReadOnlySpan<>, the C# compiler fails to resolve the overload resolution candidates during Editor compilation, explicitly demandingSystem.Memory, Version=4.0.1.2.Steps to Reproduce
4.6.0in a Unity project,Packages\manifest.json:{ "dependencies": { ... "io.sentry.unity": "https://github.com/getsentry/unity.git#4.6.0", ... } }.asmdefthat referencesio.sentry.unity.runtime.Environment
Expected vs Actual Result
Expected Behavior
The code should compile successfully in the Editor, just as it did in 4.5.0.
Actual Behavior
The Unity console throws the following compilation error:
error CS0012: The type 'ReadOnlySpan<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=null'.