JetBrains / JetBrains/resharper-unity

Serializing delegates is not supported on this platform

Open
#2,491 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.2k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Hello everyone,
We are using Rider for Unity development, and we are analyzing the changed files in our CI, so we want to use resharper command line tools for this, its working fine without the Unity extension, but when including JetBrains.Unity for resharper clt we get the following exception:
```
--- EXCEPTION #1/2 [Exception]
ClassName = System.Exception
Message = “One of the handlers for the BeforeAcquiringWriteLock has failed.”
Data.HandlerType = “System.EventHandler`1[[JetBrains.Application.Threading.BeforeAcquiringWriteLockEventArgs, JetBrains.Platform.Shell, Version=777.0.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e”
“ERROR RENDERING EXCEPTION” = “
System.Runtime.Serialization.SerializationException: Serializing delegates is not supported on this platform.
at System.MulticastDelegate.GetObjectData(SerializationInfo info, StreamingContext context)
at JetBrains.Util.ExceptionRenderer.HierarchicalDataEntry.GetChildren()
at JetBrains.Util.ExceptionRenderer.<>c.b__27_0(HierarchicalDataEntry entry)
at JetBrains.Util.Graph.GraphAlgorithms.DepthFirstSearch[TNode](IEnumerable`1 rootcollection, Func`2 FGetLinkedNodes, PassingOnWayDownDelegate`1 FEnteringOnWayDown, Action`1 FPassingOnWayDownSimple, Action`1 FPassingOnWayUp)
at JetBrains.Util.ExceptionRenderer.RenderSingleExceptionObject(ExData exd, Boolean renderSensitiveData)
at JetBrains.Util.ExceptionRenderer.CollectExDatas(Exception exception, Boolean renderSensitiveData)
```

we tried multiple resharper cli versions and resharper-unity plugin with no luck.
environment:
OS: macos
dotnet tools: .NET 8.0.414
JetBrains Inspect Code 2025.1.7
JetBrains Unity 2025.1.4.67
Unity: 6000.0.58f2

resharper command:
`
jb inspectcode foo-game.lsn --include=Assets/Scripts/Foo.cs --no-build --no-swea --output=resharper.sarif -x=JetBrains.Unity
`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.