I'm having a problem whereby '.dic' files are being created in %TEMP% and not removed when i add custom dictionaries to textboxes/richtextboxes. This worked fine in Windows 7 but now on Win 10 we are seeing the above problem. The files are always zero bytes and are named something like 1s3iqqvw.dic.
The real app has plenty of text/richtextboxes and each time one is instantiated a new dic file gets created when the custom dictionary is added, users soon end up with hundreds of these files in their temp directories.
Whats worse is the process gets slower and slower as more .dic files get created - Windows appears to be generating the random filename then searching the directory for a duplicate before it creates it, repeating until it finds a unique one. This slows down the app considerably when there are hundreds on .dic files - we need to delete the .dic manually to fix.
the following code will recreate the issue. On Win 10 .dic files are created in %TEMP% - this is not the case on Win 7
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
//dict.txt must exist
this.textBox1.SpellCheck.CustomDictionaries.Add(new Uri("d:\\dict.txt", UriKind.Relative));
textBox1.Text = "Lorem ipsum dolor sit amet";
}
}
}
<Window x:Class="testapp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="clr-namespace:testapp"
Title="MainWindow" Height="350" Width="799"
>
<Grid>
<TextBox SpellCheck.IsEnabled="True" Height="287" Margin="6,12,0,0" Name="textBox1" VerticalAlignment="Top" HorizontalAlignment="Left" Width="759" TextWrapping="Wrap" AcceptsReturn="True"/>
</Grid>
</Window>
Is anyone aware of this issue on Windows 10? Do you have a fix?