I am developing an Excel Web Add-in in Visual Studio 2022. I have noticed, whenever I change something on the web project, then place a breakpoint in a JavaScript file while the Add-on is running, Visual Studio pulls out the previous version of the file—meaning the changes did not take effect.
I have tried to clear the web add-ins cache by going to File > Options > Trust Center > Trust Center Settings ... > Trusted Add-in Catalogues then check the clear all previously started web add-ins cache, then quit Excel.
I have tried to add a ?
query string in the script URL to change the link, and I have tried to disable caching by expanding the web.config file with the tag block below, and neither of these solved the issue.
<system.webServer>
<staticContent>
<clientCache cacheControlMode="DisableCache"/>
</staticContent>
</system.webServer>
I have also tried to press the Create Virtual Directory under the project properties' Web tab. The only solution I have found so far, is to wait a day or swap PC, whenever this happens. The project is stored on an external drive, and whenever I end the day, I quit VS (and Excel), kill node.exe then unmount the drive. I am unaware of any IIS service state. I am also aware, that IIS updates correctly, because I have updated the pages through Edge before I went to Excel.
How can I make sure with Visual Studio that Excel loads the updated JavaScript files when starting a new debugging session?
Update:
Since asking the question, what I have changed on the project, is I moved the above snippet to the web.Debug.config file, so it could never accidentally end up in production.
However, the two PC works slightly differently. Thay also slightly different in setup, but don't know every relevant differences. I state whatever I know may causing it.
On Win10, this works fine now. It has Norton Internet Security. Although it has both VS 2019 and 2022 installed, I use 2022.
Relevant(?) workloads installed:
- Office/SharePoint development
I was able to work on the add-in, while Excel was running, and accepting changes. Sadly, don't know how I got there.
On Win11, this does not work. It has MS Defender.
Relevant(?) workloads installed:
- Office/SharePoint development
- Node.js development
I have cleaned/rebuilt the project, cleared the add-in cache in Excel, and the task pane and ribbon command buttons don't appear anymore.
It appears, that on this machine, the ~remoteAppUrl
does not get replaced in the manifest file when debugging.