- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am a developer at Chaos Group and I develop V-Ray for Revit. Recently a customer contacted us and told us that Revit crashes when V-Ray for Revit starts. The bad thing is that the stack trace indicates that crash occurs in the SpectrumBIM Gamut code so we can't really do anything to fix this. Are all Revit third-party assemblies loaded in the same ApplicationDomain? This seems to be the case.
There is V-Ray Next for Revit installed and when it starts SpectrumBIM Gamut crashes Revit.
When V-Ray Next for Revit starts, it loads a Grpc Server. This causes the Grpc assembly to be loaded. It appears that SpectrumBIM Gamut listens for the CurrentDomain.AssemblyResolve event and when it receives it it tries to do something. The the exception occurs. Unfortunately, I cannot fix anything because the code is not mine, but SpectrumBIM's, i.e. the crash happens in SPTR.Gamut.Revit.App.GamutApp.CurrentDomain_AssemblyResolve(Object sender, ResolveEventArgs args)
Here is the full stack trace:
System.TypeInitializationException: The type initializer for 'Grpc.Core.Internal.PlatformApis' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'UnityEngine' or one of its dependencies. An argument was out of its legal range. (Exception from HRESULT: 0x80131502) ---> System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.Substring(Int32 startIndex, Int32 length) at SPTR.Gamut.Revit.App.GamutApp.CurrentDomain_AssemblyResolve(Object sender, ResolveEventArgs args) at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName) — End of inner exception stack trace — at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName) at Grpc.Core.Internal.PlatformApis..cctor() — End of inner exception stack trace — at Grpc.Core.Internal.PlatformApis.get_IsXamarinIOS() at Grpc.Core.GrpcEnvironment.get_IsNativeShutdownAllowed() at Grpc.Core.GrpcEnvironment.GrpcNativeInit() at Grpc.Core.GrpcEnvironment..ctor() at Grpc.Core.GrpcEnvironment.AddRef() at Grpc.Core.Server..ctor(IEnumerable`1 options) at Chaos.VRay4Revit.Addin.AssetEditor.AssetEditorServer.Start()
Chaos.VRay4Revit.Addin.AssetEditor.AssetEditorServer.Start() triggers the whole sequence of events but the crash occurs in SPTR.Gamut.Revit.App.GamutApp.CurrentDomain_AssemblyResolve
Has anyone encountered anything remotely similar, i.e. two completely different Revit addons cannot work together because all of their assemblies are loaded in one and the same application domain?
Bad news is that ALL third-party Revit add-ons execute in one and the same AppDomain. So if two different add-ons need a different version of the same .NET library I guess that the first one to load wins and the second has to pray everything works at all. Am I wrong? Here is the info: https://stackoverflow.com/questions/59501154/create-separate-appdomain-for-my-plug-in-on-revit
Thanks in advance.
Solved! Go to Solution.