System.InvalidOperationException'

Using Dispatcher to update values in GUI elements from a background thread

Reading Time: 3 minutes. Quick tip: If you’re developing something like a WPF app and you’ll need to update values on the User Interface based on a long-running operation that runs in a background thread (like depicted in my other blog post right here – that post is for a full-trust SharePoint solution, but the basic principle is the same!), you’ll probably need to use Dispatcher, or otherwise you’ll run into issues with the GUI elements being owned by another thread, and therefore forbidding access to them. This can result in an error like this: An unhandled exception of type ‘System.InvalidOperationException’ occurred in WindowsBase.dll   […]

Stock photo from pixabay.com

Simplest way to create a thread on SharePoint

Reading Time: 2 minutes. This post describes the (probably) easiest and most straightforward way of creating a new Thread in your SharePoint (or any other .NET) server-side / desktop code. Solution: how to create a new Thread Let’s face it – one should not create new Threads lightly when developing SharePoint solutions, but sometimes it’s difficult to avoid. Or sometimes it’s just the simplest way to get around weird framework limitations. Posts Related to “Simplest way to create a thread on SharePoint”:Programmatically creating readable internal names for new SharePoint fieldsSharePoint Localization – a (somewhat) comprehensive how-to!Fixing an unhandled exception about StructureMap configuration failing (messed […]