dotnet / dotnet/wpf

Can't delete word from custom dictionary in WPF TextBox on Windows 10

Open
#3,918 3 comments 1 reaction 0 assignees View on GitHub
.NET Framework Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

I have an application that adds custom words for a WPF spellchecker by adding an in-memory file to the SpellCheck.CustomDictionaries property.

I can add words to the file, and they won't be considered misspelled.

The problem occurs when I try to remove a word that was previously listed. On Windows 7, this works fine. But on Windows 10, the word continues to be considered as properly spelled.

I've noticed that every time I run the application, a file path entry is placed in the registry in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Spelling\Dictionaries\en-US, that points to a .dic file in folder C:\Users\\AppData\Local\Temp\WPF. It looks like previous versions of the custom dictionary is cached here, and that is what's preventing the deleted word from displaying as misspelled. Clearing the file paths and the .dic files makes the problem go away.

Here's a video that shows the problem:
[https://youtu.be/hylPNR2Q46k]

Here's a GitHub repository for the demo program:
[https://github.com/garzooma/TestSpellCheck]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.