C#C
C#7mo ago
kocha

✅ Hot Reload not working with Interceptors

I have a problem, as soon as I make a change in a file that forces my SourceGenerator to generate a new interceptor method, hot reload stops working. Has anybody had this issue before? I get this error in VS:
 17:50:01.35 Sample.LayoutTest (3): [Error] Errors found in application: 
17:50:01.35 [Error] C:\Programming\Github\flamui\Flamui.slnx (line 1): error ENC1002: Cannot apply changes -- unexpected error: 'Unexpected null - file EditSession.cs line 708'
17:50:01.35 Sample.LayoutTest (3): [Error] C:\Programming\Github\flamui\Flamui.slnx(0,0,0,0): Cannot apply changes -- unexpected error: 'Unexpected null - file EditSession.cs line 708'
17:50:01.35 Invalid changes were found. Please refer to the Error List window to fix those issues.
17:50:01.38 [Error] Exception while emitting update: System.InvalidOperationException: Unexpected null - file EditSession.cs line 708
   at Microsoft.CodeAnalysis.Contract.Fail(String message, Int32 lineNumber, String filePath)
   at Microsoft.CodeAnalysis.EditAndContinue.EditSession.MergePartialEdits(Compilation oldCompilation, Compilation newCompilation, IReadOnlyList`1 edits, ImmutableArray`1& mergedEdits, ImmutableHashSet`1& addedSymbols, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.EditAndContinue.EditSession.GetProjectChangesAsync(ActiveStatementsMap baseActiveStatements, Compilation oldCompilation, Compilation newCompilation, Project oldProject, Project newProject, ImmutableArray`1 changedDocumentAnalyses, CancellationToken cancellationToken)
   at Microsoft.CodeAnalysis.EditAndContinue.EditSession.EmitSolutionUpdateAsync(Solution solution, ActiveStatementSpanProvider solutionActiveStatementSpanProvider, UpdateId updateId, CancellationToken cancellationToken)
Was this page helpful?