My scenario:
void Installer1_AfterInstall(object sender, InstallEventArgs e) { try { MainWindow ObjMain = new
I had that error before and the easiest way is using Dispatcher. See my Question and answer
answer
Good Luck