Skip to content

Commit a4bf757

Browse files
DYN-9958 WebView2 Cache Folder Code Review
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).
1 parent 657c8d6 commit a4bf757

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/DynamoCoreWpf/Utilities/WebView2Utilities.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Threading;
55
using System.Threading.Tasks;
66
using System.Windows;
7+
using Dynamo.Configuration;
78
using Dynamo.Models;
89
using Dynamo.Wpf.Properties;
910
using DynamoUtilities;
@@ -113,13 +114,12 @@ public static bool ValidateWebView2RuntimeInstalled()
113114
internal static string GetTempDirectory()
114115
{
115116
// Create a temp folder unique to this Dynamo instance based on process id
116-
string instanceId = Process.GetCurrentProcess().Id.ToString();
117+
string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
117118
string tmpDataFolder = Path.Combine(
118-
Path.GetTempPath(),
119-
"Dynamo",
120-
"WebView2",
121-
$"instance_{instanceId}"
122-
);
119+
localAppData,
120+
"Temp",
121+
Configurations.DynamoAsString,
122+
"WebView2");
123123
return tmpDataFolder;
124124
}
125125
}

0 commit comments

Comments
 (0)