Thank you for the playback steps. I was able to reproduce your problem.
As far as I can tell, the Visual Studio IDE uses controls, not forms.
Not knowing which function is designed for your form, I just added the basic example below to get started.
There can be many other ways to do this. I am not an AddIn developer, and therefore my knowledge is limited in this area.
User control
First, right-click the project and add a new user control. In my example, I named my "MyForm" and placed a simple button on it, showing "Hello" when clicked. This user control will be your form.
namespace MyAddin1 { public partial class MyForm : UserControl { public MyForm() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Hello"); } } }
Form creation
We need to use the application that hosts your AddIn and an instance of your AddIn. Both are members already declared in your AddIn project: _applicationObject and _addInInstance. They are set in the OnConnection event.
In the code below, I create a new tool window in which my user control is located. I am using the Windows2.CreateTooWindow2 method for this.
I added example code to the Excec event, as shown below. Again, I'm not sure if this is the right place for him, but it should be sufficient to demonstrate the code.
I tested an application that added my add-in to the IDE's tools menu, and when I clicked on my Addin, it showed a window and it worked. It also did not freeze, freeze or nothing when showing the Build Dialog.