问题
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...
This problem is caused by the Settings configured in the project
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?
来源:https://stackoverflow.com/questions/43732766/excel-add-in-not-working-after-publish