Goal: add my custom copyright template to a code file when doing code cleanup.
Environment: Coderush version 22.2.3, Visual Studio Pro 2022 x64, windows 10 x64, c# plain/empty class to test it on.
Issue: During code cleanup by action via: ctrl + ` I'd like to think about 50% of the time, i get this error with the stack trace (see below). Sometimes i make a change to an irrelevant setting and it works again, and then the next day, with no config change, it breaks again, not really sure why it throws that exception sometimes. I attached the settings i have for the copyright template and all.
Error: The 'Add copyright header' rule encountered an error and applying Code Cleanup was aborted.
Error: Message: The 'Add copyright header' rule encountered an error and applying Code Cleanup was aborted.
Error: Type: DevExpress.CodeAnalysis.CodeCleanUp.CodeCleanupHangedException
Error: HResult: 80131500
Error: Source: DevExpress.CodeAnalysis
Error: StackTrace:
Error: at DevExpress.CodeAnalysis.CodeCleanUp.CodeCleanUpEngine.<Apply>d__31.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at DevExpress.CodeAnalysis.CodeCleanUp.CodeCleanUpEngine.<Apply>d__39.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at DevExpress.CodeAnalysis.CodeCleanUp.CodeCleanUpEngine.<Apply>d__40.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at DevExpress.CodeAnalysis.Refactorings.RefactoringAction.<Apply>d__5.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at DevExpress.CodeAnalysis.Refactorings.RefactoringAction.<Apply>d__5.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at DevExpress.CodeAnalysis.Workspaces.RefactoringCodeAction.<GetChangedSolutionAsync>d__33.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at DevExpress.CodeAnalysis.Workspaces.BaseCodeAction.<ComputeOperationsAsync>d__20.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at Microsoft.CodeAnalysis.CodeActions.CodeAction.<ComputeOperationsAsync>d__26.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at Microsoft.CodeAnalysis.CodeActions.CodeAction.<GetOperationsCoreAsync>d__23.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.<InvokeWorkerAsync>d__20.MoveNext()
Error: — End of stack trace from previous location where exception was thrown —
Error: at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Error: at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Error: at Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.<PerformActionAsync>d__2.MoveNext()
Hi,
I reproduced this issue. We will fix it shortly. As a workaround, you can disable the "Auto line terminator" check box for the "h" template:
If you use the settings I corrected for you in the T1137907 ticket, it contains this workaround already applied. Let me know if this helps.
You a doctor? because my headache is now gone lol. I can confirm it is working in the settings you provided in the other ticket. Glad i could also help report a bug from my usage. Thanks again!