Skip to content

Conversation

@RobertGlobant20
Copy link
Contributor

@RobertGlobant20 RobertGlobant20 commented Jan 11, 2026

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

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)
Copy link

@github-actions github-actions bot left a 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

Copy link
Contributor

Copilot AI left a 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 in WebView2Utilities
  • Updated the cache location to use Path.GetTempPath() instead of Environment.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()

@RobertGlobant20
Copy link
Contributor Author

This is a GIF showing the 4.1 folder is not created anymore in C:\Users<user>\AppData\Roaming\Dynamo\Dynamo Core when using Dynamo on Revit.
explorer_ObRY7F9pEK

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()
@RobertGlobant20
Copy link
Contributor Author

RobertGlobant20 commented Jan 12, 2026

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:
C:\Users<user>\AppData\Local\Temp<temp-guid>\Dynamo\WebView2\instance_, the folder weight is around 9.55 MB.

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).
@zeusongit
Copy link
Contributor

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: C:\Users\AppData\Local\Temp\Dynamo\WebView2\instance_, the folder weight is around 9.55 MB.

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).

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?

@RobertGlobant20
Copy link
Contributor Author

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: C:\Users\AppData\Local\Temp\Dynamo\WebView2\instance_, the folder weight is around 9.55 MB.
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).

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?

@zeusongit

  • yes, the 4.x folder won't be created anymore under C:\Users<user>\AppData\Roaming\Dynamo\Dynamo Core just for Dynamo on Revit (for DynamoSandbox it should be continue creating this folder).
  • I've tested opening several Revit instances and opening Dynamo and also tested using several DynamoSandbox instances.

could you elaborate more about the conflicts that you are talking about?

@RobertGlobant20
Copy link
Contributor Author

This an example screenshot of the folder created when opening Dynamo on Revit, as you can see is using a guid automatically generated by the Path.GetTempPath() method (so each time Revit is opened a different guid will be used with the corresponding WebView2 cache folder inside).
image

@RobertGlobant20
Copy link
Contributor Author

This is a DynamoSandbox screenshot example of the folders generated when I opened 3 DynamoSandbox instances at the same time, inside the instace_<process_id> folder we will found the WebView2 cache folder.
image

@zeusongit
Copy link
Contributor

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).
@RobertGlobant20
Copy link
Contributor Author

could you elaborate more about the conflicts that you are talking about?

conflicts like running D4R and sandbox together or at different intervals.

with my latest changes in the commit: a4bf757
I've tested with two Revit instances (Dynamo opened) and two DynamoSanbox instances all opened at the same time and I didn't see any problem.

@QilongTang
Copy link
Contributor

QilongTang commented Jan 14, 2026

could you elaborate more about the conflicts that you are talking about?

conflicts like running D4R and sandbox together or at different intervals.

with my latest changes in the commit: a4bf757 I've tested with two Revit instances (Dynamo opened) and two DynamoSanbox instances all opened at the same time and I didn't see any problem.

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?

@zeusongit
Copy link
Contributor

could you elaborate more about the conflicts that you are talking about?

conflicts like running D4R and sandbox together or at different intervals.

with my latest changes in the commit: a4bf757 I've tested with two Revit instances (Dynamo opened) and two DynamoSanbox instances all opened at the same time and I didn't see any problem.

LGTM

@QilongTang QilongTang merged commit 6d13465 into DynamoDS:master Jan 15, 2026
25 of 27 checks passed
@QilongTang
Copy link
Contributor

@RobertGlobant20 @zeusongit Do we need to consider this for 4.0.2 release?

@RobertGlobant20 RobertGlobant20 added this to the 4.0.2 milestone Jan 16, 2026
@RobertGlobant20
Copy link
Contributor Author

/cherrypick

github-actions bot pushed a commit that referenced this pull request Jan 16, 2026
@github-actions
Copy link

Successfully created backport PR for RC4.0.2_master:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants