You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[severity:It bothers me. A fix would be nice]
I have a logging class that uses source generators to help with logging Api calls: internal static partial class ApiLogger. This class has a number of methods that are defined for example like this:
If using rename command on one of the parameters, VS will give an error "Feature 'Rename' is currently unavailable due to an internal error." and a stack trace:
StreamJsonRpc.RemoteInvocationException: The given key 'SourceFile(C:\my-project\obj\Debug\net8.0\Microsoft.Gen.Logging\Microsoft.Gen.Logging.LoggingGenerator\Logging.g.cs[5972..5983))' was not present in the dictionary.
at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__156`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Threading.Tasks.ValueTask`1.get_Result()
at Microsoft.CodeAnalysis.Remote.BrokeredServiceConnection`1.<TryInvokeAsync>d__18`1.MoveNext()
RPC server exception:
System.Collections.Generic.KeyNotFoundException: The given key 'SourceFile(C:\my-project\obj\Debug\net8.0\Microsoft.Gen.Logging\Microsoft.Gen.Logging.LoggingGenerator\Logging.g.cs[5972..5983))' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Collections.Immutable.ImmutableArray`1.Builder.AddRange(IEnumerable`1 items)
at Microsoft.CodeAnalysis.CSharp.Rename.CSharpRenameConflictLanguageService.ComputeDeclarationConflictsAsync(String replacementText, ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable`1 referencedSymbols, Solution baseSolution, Solution newSolution, IDictionary`2 reverseMappedLocations, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.AddDeclarationConflictsAsync(ISymbol renamedSymbol, ISymbol renameSymbol, IEnumerable`1 referencedSymbols, MutableConflictResolution conflictResolution, IDictionary`2 reverseMappedLocations, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.IdentifyConflictsAsync(HashSet`1 documentIdsForConflictResolution, IEnumerable`1 allDocumentIdsInProject, ProjectId projectId, MutableConflictResolution conflictResolution, ImmutableHashSet`1 conflictLocations)
at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.ResolveConflictsAsync()
at Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.ResolveSymbolicLocationConflictsInCurrentProcessAsync(SymbolicRenameLocations renameLocations, String replacementText, ImmutableArray`1 nonConflictSymbolKeys, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteRenamerService.<>c__DisplayClass4_0.<<ResolveConflictsAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<>c__DisplayClass7_0`1.<<RunWithSolutionAsync>g__ProcessSolutionAsync|1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.RunWithSolutionAsync[T](AssetProvider assetProvider, Checksum solutionChecksum, Boolean updatePrimaryBranch, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunWithSolutionAsync[T](Checksum solutionChecksum, Func`2 implementation, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Remote.BrokeredServiceBase.RunServiceImplAsync[T](Func`2 implementation, CancellationToken cancellationToken)
I'd guess it's a common problem when using automated features with source generation.
Original Comments
Feedback Bot on 31/3/2025, 01:48 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered:
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice]
I have a logging class that uses source generators to help with logging Api calls:
internal static partial class ApiLogger
. This class has a number of methods that are defined for example like this:If using rename command on one of the parameters, VS will give an error "Feature 'Rename' is currently unavailable due to an internal error." and a stack trace:
I'd guess it's a common problem when using automated features with source generation.
Original Comments
Feedback Bot on 31/3/2025, 01:48 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: