|
David Redl
Posts: 10
Joined: 2025-07-28
|
Hey team. My team upgraded our Add-in Express to the latest version a few months ago and ever since then we've run into error messages when some users (but not all) register or unregister our add-in: "Object reference not set to an instance of the object."
Based on your response elsewhere in the forums, we combed through our code to ensure that we weren't relying on Excel existing at any point (no code in the constructor, no static classes or members that could rely on an Excel host). That didn't bear any fruit.
Just now, a developer was able to pin down the bug to AddinExpress.Deployment.MainForm.RefreshSettings() and specifically this code here:
else if (Globals.CompareADXStrings(xmlNode2.ChildNodes[j].Name, "productKey"))
{
productKey = xmlNode2.ChildNodes[j].FirstChild.Value;
}
It seems that although there is a "productKey" node, it has no children.
Can you please explain why "productKey" here might not have children? Could you add a check to verify that there are children before trying to access them? |
|
|
Andrei Smolin
Add-in Express team
Posts: 19240
Joined: 2006-05-11
|
Hello David,
I believe, we should have foreseen such an exception. Nevertheless, handling it would only provide a more readable message, not solve the issue.
We suppose the ClickOnce installation is in some way broken. If there's a reproducible scenario, you could check the files located in the ClickOnce cache - start with the folder shown in the Installed Add-ins dialog or COM Add-ins dialog. You can also install a test add-in and compare the files of the two add-ins: real and test ones. If the test add-in shows this behavior, send it to us using the contact form at https://www.add-in-express.com/support/askus.php.
Regards from Poland (GMT+1),
Andrei Smolin
Add-in Express Team Leader |
|
|
David Redl
Posts: 10
Joined: 2025-07-28
|
Thanks for the reply, Andrei.
The XML that is being parsed in that code block is from %LOCALAPPDATA%\My ClickOnce Applications\products.config
I can confirm that our product entry in there shows <productKey />
Can you help me understand what an expected value for that node would be or how we would go about setting a value for it? |
|
|
Andrei Smolin
Add-in Express team
Posts: 19240
Joined: 2006-05-11
|
Hello David,
I suggest that you create a test add-in, deploy it and compare the files of the real and test add-ins.
Also you can try to repair your real add-in.
Does this issue affect a given machine/user only?
Regards from Poland (GMT+1),
Andrei Smolin
Add-in Express Team Leader |
|
|
David Redl
Posts: 10
Joined: 2025-07-28
|
To answer your question about whether this affects a given machine/user only: no. This issue is currently affecting all users of our add-in who use the Register and Unregister buttons that appear in the black-box {addinName}.exe file that you generate for us. Based on the scope of impact, this issue represents significant financial and reputational harm if we are not able to resolve this in a timely fashion.
As per your suggestion, we created a test add-in and deployed it using as much of our existing automation as possible, including signing the code and manifest the same way. The test add-in did supply a value to its <productKey> element inside %LOCALAPPDATA%\My ClickOnce Applications\products.config , unlike our actual add-in.
Since you have not told me how your adxpublisher or the generated executable comes up with this product key, I've spent a couple hours looking around for where it might be persisted to identify why our actual add-in is missing one but have come up blank:
- The productKey value that the test add-in supplies doesn't appear anywhere in our repository (Visual Studio Code search).
- It also doesn't appear on the computers it is installed to in the ClickOnce caches or in the temp folder (Windows searches) or in the downloaded `.application` file (Notepad++ search).
- It also doesn't appear on the virtual machine where we build and deploy it in the agent folder, Program Files folders, temp folder, or local app data folder (Windows searches) or in the registry (regedit search).
- It also doesn't appear in our deploy target folder in S3 (manual inspection).
- It is not a portion of the public key generated at the same time as our test add-in's .snk file nor is it a portion of our code-signing certificate's public key.
During testing, I noted that the productKey doesn't change when updating the test add-in in-place or when uninstalling and re-installing it. It also doesn't change if we build and deploy it from a different virtual machine.
Apart from that avenue of investigation, I looked for relevant logs in the following locations to see if our actual add-in logs any problems during installation but came up empty-handed:
- %localappdata%\Apps\2.0
- %localappdata%\Deployment
- %temp%\Deployment
|
|