Excel Add-In not working after publish

2019-09-15 01:23发布

I've created an Excel COM Add-In in C# using Visual Studio 2013 Professional which displays a CustomTaskPane as a right sidebar in Excel.

This is working perfect when running it directly from the IDE, but not working when installing it from the setup file generated when I published the solution.

The Add-In MyAddIn appears in the Add-Ins list, but it stays Inactive at all times when I try to activate it by pressing the Go... button at the bottom and then mark the add-in to activate it.

Any solution would help me a lot... enter image description here


This problem is caused by the Settings configured in the project
enter image description here

This is how is use them:

public UserControlSDR()
{
    InitializeComponent();
    string settingAdbKey = Properties.Settings.Default.adbeKey;
    string settingAdbUser = Properties.Settings.Default.adbeUser;
    string settingOpKey = Properties.Settings.Default.opKey;

    textBoxAdbKey.Text = settingAdbKey.Substring(settingAdbKey.LastIndexOf(":") + 2);
    textBoxAdbUser.Text = settingAdbUser.Substring(settingAdbUser.LastIndexOf("Text: ") + 6);
    textBoxOpKey.Text = settingOpKey.Substring(settingOpKey.LastIndexOf(":") + 1);
}

If I remove the code below InitializeComponent() everything works fine ... why?

0条回答
登录 后发表回答