Bug Report T253969
Visible to All Users

CodeRush for Roslyn Preview - An error occurs when trying to use the "Add to Dictionary" code fix

created 10 years ago (modified 10 years ago)

And crashes VS

Unhandled exception:
System.IO.DirectoryNotFoundException
Could not find a part of the path 'C:\Users{user}\AppData\Roaming\CodeRush\Settings\Private\custom.dic'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.StreamWriter…ctor(String path, Boolean append, Encoding encoding)
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.SaveToFile()
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.Save()
   at DevExpress.XtraSpellChecker.SpellCheckerCustomDictionary.AddWord(String word)
   at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellCheckerFactory.AddToDictionary(String word)
   at DevExpress.CodeRush.VSFeatures.SpellChecker.SpellItemChecker.AddToDictionary(String word)
   at DevExpress.CodeAnalysis.Spell.SpellCheckerService.AddToDictionary(String word)
   at DevExpress.CodeRush.VSFeatures.SpellChecker.Taggers.AddToDictionarySmartTagAction.Invoke()
   at Microsoft.VisualStudio.Language.Intellisense.Implementation.SmartTagMenuCommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

Comments (2)

    Workaround: manually create file 'C:\Users{User}\AppData\Roaming\CodeRush\Settings\Private\custom.dic'

    DevExpress Support Team 10 years ago

      Hi Joel,

      I wanted to take a moment to thank you for trying the CodeRush for Roslyn Preview. We appreciate it greatly.

      I have managed to reproduce this crash locally and we prepared necessary changes to fix this problem. You can download this build containing these changes.

      Note: To install the build, follow these steps:

      1. Download the DevExpress.CodeRush.Roslyn-1.0.3.15162.zip zip archive containing the CodeRush for Roslyn vsix container.
      2. Extract the CodeRush for Roslyn vsix container from that archive.
      3. Close all Visual Studio instances.
      4. Install the CodeRush for Roslyn extension by double-clicking the vsix file. The setup should start automatically.

      Answers approved by DevExpress Support

      created 10 years ago (modified 10 years ago)

      We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

      Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.