Open apsthisdev opened 2 years ago
Thanks for reporting the issue. Based on the call stack it looks like it is specifically the usage of a file header that is causing an issue. Out of curiosity if you remove the file header does it work as expected?
Hi,
The CodeMaid for VS 2022 command Cleanup Selected Code on .csproj or on a namespace folder throws an exception.
I have to manually open each .cs file and then run Cleanup Selected Code individually. This is a pain for project with lot of files.
Earlier version was opening the file and then cleaning it up.
Here is the log that I get...
[CodeMaid Warning 02:27:55 PM] Activation was not completed before cleaning began for 'test.cs' [CodeMaid Handled Exception 02:28:01 PM] CodeMaid Cleanup for 'test.cs' was stopped: System.Runtime.InteropServices.COMException (0x8001010E): ReplaceFileHeaderDocumentStart must be called on the UI thread. at Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread(String callerMemberName) at SteveCadwallader.CodeMaid.Logic.Cleaning.FileHeaderLogic.ReplaceFileHeaderDocumentStart(TextDocument textDocument, String settingsFileHeader) in C:\projects\codemaid\CodeMaidShared\Logic\Cleaning\FileHeaderLogic.cs:line 237 at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.RunCodeCleanupCSharp(Document document) in C:\projects\codemaid\CodeMaidShared\Logic\Cleaning\CodeCleanupManager.cs:line 264 at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupManager.<>c__DisplayClass19_0.b__0() in C:\projects\codemaid\CodeMaidShared\Logic\Cleaning\CodeCleanupManager.cs:line 170
at SteveCadwallader.CodeMaid.Helpers.UndoTransactionHelper.Run(Action tryAction, Action`1 catchAction) in C:\projects\codemaid\CodeMaidShared\Helpers\UndoTransactionHelper.cs:line 55