The calling thread must be STA, because many UI components require this in WPF

Normally, the entry point method for threads for WPF have the [STAThreadAttribute] set for the ThreadMethod, or have the apartment state set to STA when creating the thread using Thread.SetApartmentState(). However, this can only be set before the thread is started. If you cannot apply this attribute to the entry point of the application of thread you are performing … Read more

The calling thread cannot access this object because a different thread owns it

This is a common problem with people getting started. Whenever you update your UI elements from a thread other than the main thread, you need to use: You can also use control.Dispatcher.CheckAccess() to check whether the current thread owns the control. If it does own it, your code looks as normal. Otherwise, use above pattern.

MSHTML DLL on Windows 10

I just created a blog post on this issue. The problem is that the Microsoft.mshtml.dll assembly in the Global Assembly Cache becomes unregistered from ActiveX during the upgrade process. To fix this issue, it is necessary to run “regasm” on the assembly: Open an instance of “Developer Command Prompt for VS2013” (or whatever version of Visual Studio … Read more

MSHTML DLL on Windows 10

I just created a blog post on this issue. The problem is that the Microsoft.mshtml.dll assembly in the Global Assembly Cache becomes unregistered from ActiveX during the upgrade process. To fix this issue, it is necessary to run “regasm” on the assembly: Open an instance of “Developer Command Prompt for VS2013” (or whatever version of Visual Studio … Read more

How to resolve this System.IO.FileNotFoundException

I hate to point out the obvious, but System.IO.FileNotFoundException means the program did not find the file you specified. So what you need to do is check what file your code is looking for in production. To see what file your program is looking for in production (look at the FileName property of the exception), try these … Read more

How to resolve this System.IO.FileNotFoundException

I hate to point out the obvious, but System.IO.FileNotFoundException means the program did not find the file you specified. So what you need to do is check what file your code is looking for in production. To see what file your program is looking for in production (look at the FileName property of the exception), try these … Read more

XAML Binding Groups

Try specifying you binding group as DataGrid.ItemBindingGroup instead of DataGrid.BindingGroup: And in this case you actually can omit specifying the name for your binding group. It will automatically be used for all bindings in a row.