Trying to Hot Reload on C# with JetBrains Rider (works fine in VS 2022)

I need some help formulating a request or bugfix or (something like that) to JetBrains Rider.

Rider is my preferred editor for C# and I’ve been using it while learnin to write Grasshopper plugins for the past few months. It has no real issues to speak of, except for some reason Rider can’t Hot Reload during debug sessions. I tried the same on VS Community 2022 today, it worked amazing. I was even able to add and remove parameters. Just incredible.

In Rider I can do one successful major edit (like adding an input get parameter) using Hot Reload, but then it errors out. The fact that it can do ONE major edit makes me think that maybe there’s a setting or something that’s off.

Here is there error, before I try and explain what I’m doing to the JetBrains people, can any of you make heads or tails of these messages? I’ve also attached a sample project here, its simple stuff from the @LongNguyen workshop.

Event Log:
8:26 PM Can't apply changes: There was an error in changes you tried to apply, Hot Reload was disabled for the current session. Please restart the session.

stacktrace.txt:

java.lang.Throwable: Exception in debugger process: Failed to apply changes for module: Plugin_1_Day_3:1 OriginalPeFile is null

--- EXCEPTION #1/2 [InvalidOperationException]
Message = “OriginalPeFile is null”
ExceptionPath = Root.InnerException
ClassName = System.InvalidOperationException
Data.ThreadLocalDebugInfo = “endpoint `DebuggerWorkerToFrontend.DebuggerWorkerModel.activeSession.$.startDebuggerEncSession.1000219.applyEncDelta` (2614895836662920595)”
HResult = COR_E_INVALIDOPERATION=80131509
Source = Debugger.Common
StackTraceString = “
  at Debugger.Common.MetadataAndPdb.DebuggerModuleMetadata.ApplyDelta(Stream delta)
     at Mono.Debugging.Win32.CorAppDomainsInfo.CorModuleInfo.ApplyDelta(EnCDelta delta)
     at Mono.Debugging.Win32.CorAppDomainsInfo.CorModuleInfo.ApplyEncDelta(EnCDelta delta)
     at Mono.Debugging.Win32.Enc.EncDeltaApplier.ApplyDeltasIfNeeded(CorModuleInfo moduleInfo, String& message)
”

--- Outer ---

--- EXCEPTION #2/2 [LoggerException]
Message = “Failed to apply changes for module: Plugin_1_Day_3:1 OriginalPeFile is null”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #1 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
  at JetBrains.Util.ILoggerEx.LogException(ILogger this, LoggingLevel level, Exception exception, ExceptionOrigin exceptionOrigin, String comment)
     at JetBrains.Util.ILoggerEx.Error(ILogger this, Exception ex, String message)
     at Mono.Debugging.Win32.Enc.EncDeltaApplier.ApplyDeltasIfNeeded(CorModuleInfo moduleInfo, String& message)
     at Mono.Debugging.Win32.Enc.EncDeltaApplier.ApplyDeltaIfNeeded(EnCDelta delta, String& message)
     at Mono.Debugging.Win32.CorDebuggerSession.ApplyDelta(EnCDelta delta, String& message)
     at JetBrains.Debugger.Worker.DebugSessionFrontend.<>c__DisplayClass62_0.<ApplyEncChangesSync>b__0(EnCDelta delta)
     at JetBrains.Debugger.Worker.EnC.EnCDeltaProvider.CallSafe(Func`2 callback)
     at JetBrains.Debugger.Worker.EnC.EnCDeltaProvider.GetEncDelta(Func`2 callback)
     at JetBrains.Debugger.Worker.DebugSessionFrontend.ApplyEncChangesSync(Lifetime lifetime, Int32 buildId)
     at JetBrains.Debugger.Worker.DebugSessionFrontend.ApplyEnc(Lifetime lifetime, Int32 buildId)
     at JetBrains.Debugger.Worker.DebugSessionFrontend.<>c__DisplayClass59_0.<StartDebuggerEncSession>b__0(Lifetime lf, Int32 buildId)
     at JetBrains.Rd.Tasks.RdCall`2.OnWireReceived(UnsafeReader reader)
     at JetBrains.Rd.Impl.MessageBroker.Execute(IRdWireable reactive, Byte[] msg)
     at Threading.QueuedTasks.ProcessDebuggerTask(QueuedDebuggerTask& item)
     at Threading.QueuedTasks.Pump(Func`1 condition, TimeSpan timeout, QueuedDebuggerTaskType type)
     at JetBrains.Debugger.Worker.DebuggerWorkerMain.<>c.<Main>b__3_0()
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ThreadHelper.ThreadStart()
”

	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
	at com.jetbrains.rider.debugger.DebuggerWorkerProcessHandlerBase$1.invoke(DebuggerWorkerProcessHandlerBase.kt:22)
	at com.jetbrains.rider.debugger.DebuggerWorkerProcessHandlerBase$1.invoke(DebuggerWorkerProcessHandlerBase.kt:9)
	at com.jetbrains.rd.util.reactive.Signal.fire(Signal.kt:32)
	at com.jetbrains.rd.framework.impl.RdSignal.onWireReceived(RdSignal.kt:42)
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:56)
	at com.jetbrains.rd.framework.MessageBroker$invoke$2$2.invoke(MessageBroker.kt:11)
	at com.jetbrains.rd.framework.impl.ProtocolContexts.readMessageContextAndInvoke(ProtocolContexts.kt:151)
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:55)
	at com.jetbrains.rd.framework.MessageBroker$invoke$2.invoke(MessageBroker.kt:11)
	at com.jetbrains.rdclient.protocol.RdDispatcher.flushAll(RdDispatcher.kt:97)
	at com.jetbrains.rdclient.protocol.RdDispatcher.access$flushAll(RdDispatcher.kt:18)
	at com.jetbrains.rdclient.protocol.RdDispatcher$flushAllRunnable$1.run(RdDispatcher.kt:23)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
	at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
	at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:951)
	at com.intellij.openapi.progress.util.ProgressWindow.lambda$startBlocking$6(ProgressWindow.java:221)
	at com.intellij.openapi.application.impl.ApplicationImpl.runUnlockingIntendedWrite(ApplicationImpl.java:831)
	at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:217)
	at com.jetbrains.rider.services.RiderGlobalProgressHostKt.runSynchronouslyUnderProgress(RiderGlobalProgressHost.kt:150)
	at com.jetbrains.rider.debugger.editAndContinue.DotNetHotReloadManager.u(DotNetHotReloadManager.kt:361)
	at com.jetbrains.rider.debugger.editAndContinue.DotNetHotReloadManager.T(DotNetHotReloadManager.kt:324)
	at com.jetbrains.rider.debugger.editAndContinue.DotNetHotReloadManager.applyChangesIfNeeded(DotNetHotReloadManager.kt:224)
	at com.jetbrains.rider.debugger.editAndContinue.EncUtilKt.applyChangesIfNeededWithRebuildViews(EncUtil.kt:61)
	at com.jetbrains.rider.debugger.dialogs.RiderHotReloadNotifier$getNotifier$$inlined$let$lambda$1.invoke(RiderHotReloadNotifier.kt:45)
	at com.jetbrains.rider.debugger.dialogs.RiderHotReloadNotifier$getNotifier$$inlined$let$lambda$1.invoke(RiderHotReloadNotifier.kt:17)
	at com.jetbrains.rider.ui.RiderEditorNotifier$buildPanel$3.run(RiderEditorNotifier.kt:90)
	at com.intellij.ui.EditorNotificationPanel$2.handlePanelActionClick(EditorNotificationPanel.java:305)
	at com.intellij.ui.EditorNotificationPanel$ActionHyperlinkLabel$1.hyperlinkActivated(EditorNotificationPanel.java:351)
	at com.intellij.ui.HyperlinkAdapter.hyperlinkUpdate(HyperlinkAdapter.java:11)
	at com.intellij.ui.HyperlinkLabel.fireHyperlinkEvent(HyperlinkLabel.java:240)
	at com.intellij.ui.HyperlinkLabel.processMouseEvent(HyperlinkLabel.java:162)
	at java.desktop/java.awt.Component.processEvent(Component.java:6419)
	at java.desktop/java.awt.Container.processEvent(Container.java:2263)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5029)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2790)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4861)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
	at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:820)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:757)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Plugin_1_Day_3.zip (94.5 KB)

1 Like

To my eye your post looks good enough as bug report. It includea steps and stacktrace.

That’s really interesting, I’d love to see this hot reload working with GH plugin development. I haven’t tried it in Rider yet, I kind of got used to compiling, placing dlls to proper folder, running it. But the fact that you can avoid it is really interesting.