-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception on prompting for cleaning external files #748
Comments
Thanks for reporting the issue, and I'm glad to hear you're otherwise liking CodeMaid. :) The "external files" prompt happens when there are files that are not included in the solution. Since cleaning up all files already provides a progress dialog, I suspect the attempt to show a second dialog when one is already open fails. I was able to reproduce the issue and for me it silently failed to clean up that file and continued on with the rest of the files cleanly. Is that what you are seeing as well? One workaround would be to explicit make a selection with the setting at CodeMaid->Options->Cleaning->General->"Perform partial cleanup if file is not in the solution". It defaults to "Ask" but you can change it to "Yes" or "No" which would avoid the dialog altogether. |
* Translate a newly added line * Remove unused package references * Eliminate redundant output via package reference manner * Add missing references to fix unit tests build issue * Fix cleanup external files issue #748
Environment
Description
Thanks for a really great addin!
I think I've come across a bug - on trying to clean the whole solution from within Visual Studio, I got an exception:
[CodeMaid Handled Exception 05:54:07 AM] Unable to prompt user about cleaning external files: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. at System.Windows.Input.InputManager..ctor() at System.Windows.Input.InputManager.GetCurrentInputManagerImpl() at System.Windows.Input.KeyboardNavigation..ctor() at System.Windows.FrameworkElement.FrameworkServices..ctor() at System.Windows.FrameworkElement.EnsureFrameworkServices() at System.Windows.FrameworkElement..ctor() at System.Windows.Controls.Control..ctor() at System.Windows.Window..ctor() at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupAvailabilityLogic.PromptUserAboutCleaningExternalFiles(Document document) in C:\projects\codemaid\CodeMaid\Logic\Cleaning\CodeCleanupAvailabilityLogic.cs:line 425 [CodeMaid Handled Exception 05:54:07 AM] Unable to prompt user about cleaning external files: System.InvalidOperationException: The calling thread must be STA, because many UI components require this. at System.Windows.Input.InputManager..ctor() at System.Windows.Input.InputManager.GetCurrentInputManagerImpl() at System.Windows.Input.KeyboardNavigation..ctor() at System.Windows.FrameworkElement.FrameworkServices..ctor() at System.Windows.FrameworkElement.EnsureFrameworkServices() at System.Windows.FrameworkElement..ctor() at System.Windows.Controls.Control..ctor() at System.Windows.Window..ctor() at SteveCadwallader.CodeMaid.Logic.Cleaning.CodeCleanupAvailabilityLogic.PromptUserAboutCleaningExternalFiles(Document document) in C:\projects\codemaid\CodeMaid\Logic\Cleaning\CodeCleanupAvailabilityLogic.cs:line 425 [CodeMaid Warning 05:54:29 AM] Activation was not completed before cleaning began for 'Program.cs'
I didn't get any sort of prompt window being displayed, so this is presumably at the outermost layer of trying to ask me something. This is the full text from the Output Window, so there's no info to give us a clue about which worker thread was trying to show a prompt window, if it's not obvious from the design. None of the external files were changed.
I hope that's enough info. Please let me know if you need more.
The text was updated successfully, but these errors were encountered: