Visual studio 2010, C#...
Form1.cs
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("Success");
string projPath = "";
}
}Visual Studio Addin Code (Connect.cs)
public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
{
handled = false;
if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
{
if(commandName == "CustomWorkItem.Connect.CustomWorkItem")
{
handled = true;
Form1 frm = new Form1();
frm.Show();
return;
}
}
}Problem: So when I click on the Addin under visual studio Tools, it works fine till it shows the message box and then it throws an error causing the visual studio to close..not sure why this is happening..
Do i have to invoke the winform in a different manner?