roslyn icon indicating copy to clipboard operation
roslyn copied to clipboard

Exception from Visual Studio while coding

Open ArchieCoder opened this issue 1 year ago • 5 comments

Latest VS version. Exception happens while coding.

System.InvalidOperationException : The solution does not contain the specified document.
   at Microsoft.CodeAnalysis.Shared.Extensions.ISolutionExtensions.GetRequiredDocument(Solution solution,DocumentId documentId)
   at async Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.GetRenamedSymbolInCurrentSolutionAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.IdentifyConflictsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.Session.ResolveConflictsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.ConflictEngine.ConflictResolver.ResolveSymbolicLocationConflictsInCurrentProcessAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.Renamer.RenameSymbolInCurrentProcessAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.Renamer.RenameSymbolAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Rename.Renamer.RenameSymbolAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCommitter.RenameSymbolWorkerAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCommitter.RenameSymbolAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.RenameTracking.RenameTrackingTaggerProvider.RenameTrackingCodeAction.ComputePreviewOperationsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.PreviewChangesSuggestedAction.CreateAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.GetPreviewChangesFlavorAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.CreateAllFlavorsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)

ArchieCoder avatar Feb 12 '24 23:02 ArchieCoder

I suspect this issue will be heavily mitigated in 17.10 Preview 1 by #68214

sharwell avatar Feb 13 '24 18:02 sharwell

Any update on this? I'm on 17.9.6.

image

ArchieCoder avatar May 09 '24 15:05 ArchieCoder

No update. Do you have a repro you could provide us with?

CyrusNajmabadi avatar May 09 '24 15:05 CyrusNajmabadi

This is not the same callstack, but it is the same exception description

I just deleted the whole property: IsApplicationNameShown

public sealed partial class TitleControl : UserControl
{
    public static readonly DependencyProperty TitleProperty = DependencyProperty.Register(
        nameof(Title), typeof(string), typeof(TitleControl), null);

    public TitleControl()
    {
        InitializeComponent();
    }

    public bool IsApplicationNameShown
    {
        get => (bool)GetValue(IsApplicationNameShownProperty);
        set => SetValue(IsApplicationNameShownProperty, value);
    }

    public string Title
    {
        get => (string)GetValue(TitleProperty);
        set => SetValue(TitleProperty, value);
    }
}

image

ArchieCoder avatar May 10 '24 19:05 ArchieCoder

Note that this will generally not appear following #68214 (17.10 Preview 1).

I see now I mentioned that above.

sharwell avatar May 10 '24 22:05 sharwell