how save current status. registry or file?

Add-in Express™ Support Service
That's what is more important than anything else

how save current status. registry or file?
Cannot register assembly, target of an invocation 
Hyo Jin Song


Guest


Error 1 Cannot register assembly "C:\workspace\aaa\aaa\bin\Debug\aaa.dll". Exception has been thrown by the target of an invocation. aaa

public aaa()
{
InitializeComponent();

//Please write any initialization code in the OnConnect event handler
string savedValue = File.ReadAllText(@"%APPDATA%\aaa.ini");
ComboBox1.SelectedValue = savedValue;
}

I want like this.
restore ComboBox1 selected value

thank you.
Posted 29 Jan, 2014 01:15:15 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Song,

Using this code in the constructor of the add-in module is a mistake: the module is created and the constructor is invoked in many circumstances. Call the same in an event of the add-in module, say in AddinInitialize or in OnRibbonBeforeCreate.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jan, 2014 02:02:13 Top
Hyo Jin Song


Guest


thank you.
double click created aaa_Load()

I tried before dblclick panel;;
Posted 29 Jan, 2014 02:37:26 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
I'm sorry, mentioning AddinInitialize or in OnRibbonBeforeCreate was my fault, please ignore this. Still, executing this code in the constructor is incorrect, use any suitable event of the module instead.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jan, 2014 03:15:56 Top