The issue where ClickOnce store is regenerated on Win10 is resolved in the following update -
https://learn.microsoft.com/en-us/windows/release-health/resolved-issues-windows-10-22h2#august-2023
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We've been using multiple ClickOnce applications (now last built with Visual Studio 2022) on Windows 10 for many years without problems on 20 or so on production and staff computers. In the last week or so we've run into a problem where every day when starting any of our tools we get a dialog box asking us to install the program. After reinstalling the first program, all of the icons for our other ClickOnce applications turn into a generic icon and also need to be reinstalled. This occurs regardless which of the ClickOnce applications we start first.
In researching the problem we've found that this effect can occur if ClickOnce registry data is changed. We've seen that when this occurs the ComponentStore_RandomString value of the key HKEY_CURRENT_USER\SOFTWARE\Classes\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0 is changed to a new value, which seems to indicate that for some reason the ClickOnce has decided that something has gone wrong and has abandoned the currently installed tools.
Looking into the C:\Users<UserName>\AppData\Local\Apps\2.0, where the ClickOnce tools get installed, we can see that a folder name matching the first part of the new ComponentStore_RandomString is created in the early morning hours when the computer is not being used. Based on this we added an exception to our TrendMicro antivirus from scanning the C:\Users<UserName>\AppData\Local\Apps for each of the users on our domain. This seemed to correct the problem for one day but is occurring again today.
We've also tried to looking in the Event Viewer to see if we can find events that are coincident with that folder being crated but haven't been able to find anything that seems relevant.
Can anyone give me some advice on what could be causing this problem and what we can do to work around it?
The issue where ClickOnce store is regenerated on Win10 is resolved in the following update -
https://learn.microsoft.com/en-us/windows/release-health/resolved-issues-windows-10-22h2#august-2023
In my testing, 2 things worked for me:
1 – Uninstalling KB5028244 (not KB5029244) and then getting latest windows updates seems to permanently fix the ClickOnce issue.
2 –Disabling Microsoft Compatibility Appraiser scheduled task under Task Scheduler Library > Microsoft > Windows > Application Experience seemed to also work as long as the task stays disabled. As soon as I enable and run the task, all ClickOnce applications need to be reinstalled.
As Mike K mentioned above, the culprit is %windir%\system32\compattelrunner.exe which is run daily in Task Scheduler and hoses the registry and folders for our ClickOnce applications. The task is located in Task Scheduler Library > Microsoft > Windows > Application Experience and is named Microsoft Compatibility Appraiser. By far the quickest fix is to disable this task. You will probably have to reinstall ClickOnce apps one last time after disabling the task, since the damage is done each morning, but after that the reinstall cycle will be over.
From what I can tell, it is just part of the Microsoft Telemetry system when sends usage information to Microsoft. Some consider it spyware and even suggest taking ownership of the file and deleting it. I think just disabling the task is good enough for now. Microsoft may re-enable in a future update, but hopefully by then they would have fixed the underlying problem. You may be able to disable the task with Group Policy, but I haven't yet looked into that.
We are interested in how you will solve the problem, because our customers are very dissatisfied because they think that we require an upgrade and each time the user name and password are entered. Please could you put the fix on the priority list, because all of us who use ClickOnce are having big problems. Any suggestion of a solution in addition to the ones listed above will be very useful to us. We tried to prepare a working environment for debugging, but different fixes react very differently in different situations, and the error appears and then doesn't. And of course we ask if it is really connected to schuduler, so we can temporarily turn it off