-
Notifications
You must be signed in to change notification settings - Fork 668
DYN-9958 WebView2 Cache Folder #16824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DYN-9958 WebView2 Cache Folder #16824
Conversation
Updating the location of the WebView2 cache folder so when opening Dynamo the C:\Users\<user>\AppData\Roaming\Dynamo\Dynamo Core\x.x folder won't be created (for DynamoSandbox and also DynamoRevit)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9958
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR relocates the WebView2 cache folder from the user's Roaming AppData directory to a temporary directory, preventing the creation of version-specific folders in C:\Users\<user>\AppData\Roaming\Dynamo\Dynamo Core\x.x.
Changes:
- Centralized the user directory logic for WebView2 cache into a new
GetUserDirectory()method inWebView2Utilities - Updated the cache location to use
Path.GetTempPath()instead ofEnvironment.SpecialFolder.ApplicationData - Refactored three separate implementations to use the shared utility method
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/DynamoCoreWpf/Utilities/WebView2Utilities.cs | Added GetUserDirectory() method that returns a temp path for WebView2 cache |
| src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs | Replaced local implementation with call to centralized WebView2Utilities.GetUserDirectory() |
| src/DynamoCoreWpf/Views/PackageManager/Components/PackageManagerWizard/PackageManagerWizard.xaml.cs | Replaced local implementation with call to centralized WebView2Utilities.GetUserDirectory() |
| src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs | Replaced local implementation with call to centralized WebView2Utilities.GetUserDirectory() |
Fixing method access modifier and adding comment
using Guid.NewGuid() to use a different cache folder for WebView2 each time Dynamo is opened (the same case will be applied for any host).
Changing method name to GetTempDirectory()
|
Just to comment that which the latest changes everytime Dynamo is launched, one WebView2 cache folder will be created (will be shared for SplashScreen, HomePage and PackageManagerWizard) in the next location: Then every time that a new Dynamo instance is opened in Revit a folder of 9.55 MB will be generated for that specific process, if Dynamo is opened then close and then re-opened in Revit will reuse the same WebView2 cache folder (due that is the same process). |
Fixing method for not creating a WebView2 cache folder for each WebView2 instance in Dynamo, instead one folder will be created for all the WebView2 instances (if there are several Dynamo processes running the cache folder name will change).
Just to confirm, this will not create the 4.x folder in ProgramFiles anymore, right? So now we work with the cache created in Temp folder, and this has been tested for conflicts between Revit and Dynamo? |
could you elaborate more about the conflicts that you are talking about? |
conflicts like running D4R and sandbox together or at different intervals. |
Based in our last discussion, we don't need a unique path for each WebView2 instance and also we don't need a unique path per each Dynamo instance (in Revit or DynamoSandbox) so with this change we will be using the specific path C:\Users\<user>\AppData\Local\Temp\Dynamo\WebView2 for WebView2 cache folder (for DynamoSandbox and Revit).
with my latest changes in the commit: a4bf757 |
Thank you, I also never see it crashing even with two instance launching. We could use more testing from @jnealb though. FYI: @DynamoDS/eidos What do you think about the final version? |
LGTM |
|
@RobertGlobant20 @zeusongit Do we need to consider this for 4.0.2 release? |
|
/cherrypick |
(cherry picked from commit 6d13465)
|
Successfully created backport PR for |



Purpose
Updating the location of the WebView2 cache folder so when opening Dynamo the C:\Users<user>\AppData\Roaming\Dynamo\Dynamo Core\x.x folder won't be created (for DynamoSandbox and also DynamoRevit) and instead the cache folder will be created in a path like C:\Users\AppData\Local\Temp\Dynamo\WebView2\instance_<process_id>, (for both Dynamo and DynamoRevit).
Declarations
Check these if you believe they are true
Release Notes
Updating the location of the WebView2 cache folder
Reviewers
@QilongTang @reddyashish @zeusongit @aparajit-pratap
FYIs