SA1649 code fix crashes when renaming file
See original GitHub issueVisual Studio 15.3.1, attempting to rename a file “Services\HistoricalData\Implementation\RateHistoryClassMap.cs” to “Services\HistoricalData\Implementation\FullRateHistoryEntryClassMap.cs”.
The stack trace is as follows:
System.AggregateException : One or more errors occurred. ---> Could not find file 'Services\HistoricalData\Implementation\RateHistoryClassMap.cs'.
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.InvokeWorker(Func`1 getFromDocument,IProgressTracker progressTracker,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.<>c__DisplayClass18_0.<InvokeCore>b__0()
at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformAction(IExtensionManager extensionManager,Object extension,Action action)
---> (Inner Exception #0) System.IO.FileNotFoundException : Could not find file 'Services\HistoricalData\Implementation\RateHistoryClassMap.cs'.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode,IntPtr errorInfo)
at Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem.InvisibleEditor..ctor(IServiceProvider serviceProvider,String filePath,IVisualStudioHostProject projectOpt,Boolean needsSave,Boolean needsUndoDisabled)
at Microsoft.VisualStudio.LanguageServices.RoslynVisualStudioWorkspace.OpenInvisibleEditor(IVisualStudioHostDocument hostDocument)
at Microsoft.VisualStudio.LanguageServices.RoslynVisualStudioWorkspace.OpenInvisibleEditor(DocumentId documentId)
at Microsoft.VisualStudio.LanguageServices.Implementation.GlobalUndoServiceFactory.WorkspaceUndoTransaction.AddDocument(DocumentId id)
at async Microsoft.CodeAnalysis.Editor.Implementation.CodeActions.CodeActionEditHandlerService.ApplyAsync(<Unknown Parameters>)<---
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Visual Studio 2022 crashing when I try to rename/delete a file
The solution I found online was to delete the .vs folder. Reopening VS recreates the folder and json editing was fine again. Poster...
Read more >file explorer crashing when i rename something and when i ...
Whenever i rename a file my file explorer crashes and when i end the task my screen turns COMPLETLEY black. Heres an ms...
Read more >File name must match first type name` refactoring doesn't work
StyleCop `SA1649: File name must match first type name` refactoring doesn't work ... RIDER-70286 Roslyn code fix is not working for RS2008.
Read more >Windows 11 File Explorer freezes when renaming files
Hi, my file explorer lags (or freezes for few seconds) every time i rename files and happened in any folder or files in...
Read more >Rename file to refactor causes VS Freeze
4. Now, WITH OUT saving the file, click on the class name and select the refactor dropdown -> Rename file to “Test1.cs”. 5....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For the record: There is now a Renamer.RenameDocument method available from version 3.7 of Microsoft.CodeAnalysis.Workspaces.Common, which seems to require Visual Studio 16.7.
We should be able to invoke that via a light-up layer for cases where it is supported.