I am using VS2015 Update 1
I just start a new application with nothing special, no db, no COM references. Just a simple winform application.
I am getting the following error:
Error while trying to run project: Unable to start debugging.
The object invoked has disconnected from its clients.
My Code:
public partial class RegistratorForm : Form
{
public RegistratorForm()
{
InitializeComponent();
}
private void RegistratorFileBrowseButton_Click(object sender, EventArgs e)
{
using (var openDialog = new OpenFileDialog())
{
openDialog.Title = "Open Text File";
openDialog.Filter = "Registrator files|*.rgr";
openDialog.InitialDirectory = ConfigurationManager.AppSettings["DefaultRegistratorFilePath"];
if (openDialog.ShowDialog() == DialogResult.OK)
{
}
}
}
}
My Form:
My app.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="DefaultRegistratorFilePath" value="C:\"/>
</appSettings>
</configuration>
Best Answer
Try to restart Visual Studio. That should do the trick. If not, then you should do as suggested here