问题
Release an HelloWorld add-in for Ms Word. Sign and publish via ClickOnce, with the installation folder being set to an online directory.
Routine to follow
- Run the add-in setup.exe to install via ClickOnce.
- Assert the add-in has been registered in
File / Options / Add-ins. Close Word. - Go to the
Programs and Featurespanel, and uninstall the ClickOnce application which corresponds to the Add-in. - Launch Word and assert the add-in has been unregistered from
File / Options / Add-ins. - Run the add-in setup.exe to install via ClickOnce.
- Assert the add-in has been registered in
File / Options / Add-ins. - Select
Manage: COM Add-insand press [Go...]. Select the add-in and click [Remove]. - Go to the
Programs and Featurespanel, and uninstall the ClickOnce application which corresponds to the Add-in. - Run the add-in setup.exe to install via ClickOnce.
- Assert the add-in has been registered in
File / Options / Add-ins.
Results under Windows 7 + Office 365
The flow works and all steps are correct.
Results under Windows 10 + Office 365
The flow does not work.
- Step 4: Uninstalling the ClickOnce application has no effect on the add-in registration with Word.
- Step 10: Unregistering the add-in manually results in ClickOnce being unable to re-register it: it keeps telling the latest version of the Office Customization is already installed, which is not reflected in Word where no add-in appears as registered.
What to do?
I have raised several flags in the past but got no luck. I have now narrowed down the problem to Windows 10 and additional inconsistent behaviour from ClickOnce (step 4 not working).
Questions:
- Are we really the only VSTO publisher to face this highly deterministic issue?
- Should we call this a bug? Where could we flag it up?
This is a follow up to the following threads, where I never got an answer:
Unable to re-register VSTO Add-in after choosing [Remove] from COM Add-ins window
https://social.msdn.microsoft.com/Forums/office/en-US/3151614e-8921-4de0-8b4e-1be65537aa8f/unable-to-reregister-vsto-com-addin-after-choosing-remove-from-list-of-quotaddins?forum=vsto
https://social.msdn.microsoft.com/Forums/vstudio/en-US/976266bc-1ce4-4f1c-88d0-0e4e6fa14510/unable-to-reregister-ms-word-vsto-com-addin-when-deployed-through-clickonce?forum=vsto#976266bc-1ce4-4f1c-88d0-0e4e6fa14510
回答1:
The problem is not directly linked with Windows 10, but the version of Office: Store or Desktop.
By default, when installing Office on a Windows 10 computer, it is installed from the Microsoft Store.
You can tell what version is installed by checking your application version in File / Account: to the right of the [About Word] button, you will find the version and build number, followed by one of these two options:
Click-to-Run
Which means you have the desktop version installed, or
Microsoft Store
Which means you have the store version installed.
The store version causes many issues when it comes to the handling of registry keys, or even files. This issue was resolved by Andrei Smolin from Add-in Express Support Service. He has been extremely useful and diligent by resolving within 24 hrs an issue we had for months. Worth mentioning we are not event (yet) a client.
See his article for additional details.
What next?
Now the question is, how do we report this to Microsoft?
回答2:
This issue may be caused if you have built the add-in in debug on your machine and it is also installed from the deploy location.
Open the “COM Add-ins” form by either
Go to the Developer ribbon and click on the “COM Add-ins” button
Go to the "File" ribbon and click on the "Options" button. Then under “Add-Ins” select “COM Add-ins” and click “Go…”
Select the Add-in name and click the button “Remove”
Then you’ll need to uninstall the Add-in from "Programs and Features"
Also, you could try
- Type
rundll32 dfshim CleanOnlineAppCachein the command window and run it
来源:https://stackoverflow.com/questions/58529078/clickonce-does-not-unregister-re-register-vsto-solutions-when-running-from-windo