.net miner

something about life, me and .net
  • Home
  • Categories
    • C#
    • .Net
    • Tools
    • General
    • Visual Studio
    • Open Source Projects
  • Contact Me
.Net•C#•General•Tools•Visual Studio

Visual Studio Setup Project Custom Action OLE Calls And Show Dialog Support

29 August 2010 by Ozcan Degirmenci No Comments

If you are developing a setup project with visual studio which contains custom action in it, you might have problems with the OLE calls (for ex: Copy to clipboard or paste from clipboard) and showing a dialog (for ex: FolderBrowser, OpenFileDialog, SaveFileDialog etc.). This is simply because of the thread structure of the setup projects.

MSI projects does not expect that your custom actions needs OLE  calls. Therefore they are not calling your custom actions with a thread which is apartment state is STA. If you want to make OLE calls, your thread must be in STA apartment state. Therefore if you show a form in your custom action and try to call Clipboard.SetData or Clipboard.GetData in your form, then you get a STA-MTA thread exception. Also your setup project will be locked when you try to show a dialog form in your custom action form.

Continue reading

Share:
Reading time: 2 min

Search

Projects

  • Process Viewer
  • B-Msn
  • Runtime Member Proxies
  • Searchable RichTextBox

Categories

  • .Net (19)
  • C# (12)
  • General (13)
  • Open Source Projects (4)
  • Quantum (1)
  • Tools (9)
  • Visual Studio (6)

Archives

  • November 2018
  • September 2018
  • September 2010
  • August 2010
  • August 2009
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • February 2008
  • January 2008

About me

Hi, my name is Ozcan Degirmenci. I'm co-founder and CEO at Crs Soft.

Tags

Assembly Collection Editor Dialog Support Dynamic method enum Flag Editor Loader Exceptions Ole Calls Open source project open source projects Perfornance Comparison process viewer Proxy quantum Reflection Run Apps From Web schrödinger's cat Searchable Richtextbox Spoon thought experiment thread

© 2018 copyright ÖZCAN DEĞİRMENCİ // All rights reserved.