diff --git a/ConnectorCore/DllConflictManagement/DllConflictManagement.csproj b/ConnectorCore/DllConflictManagement/DllConflictManagement.csproj
index 444ad75619..658cf470c9 100644
--- a/ConnectorCore/DllConflictManagement/DllConflictManagement.csproj
+++ b/ConnectorCore/DllConflictManagement/DllConflictManagement.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/ConnectorCore/DllConflictManagement/DllConflictManager.cs b/ConnectorCore/DllConflictManagement/DllConflictManager.cs
index 28c21a8cb0..26f34f13c2 100644
--- a/ConnectorCore/DllConflictManagement/DllConflictManager.cs
+++ b/ConnectorCore/DllConflictManagement/DllConflictManager.cs
@@ -11,18 +11,22 @@ public sealed class DllConflictManager
private readonly DllConflictManagmentOptionsLoader _optionsLoader;
private readonly DllConflictEventEmitter _eventEmitter;
private readonly string[] _assemblyPathFragmentsToIgnore;
+ private readonly string[] _exactAssemblyPathsToIgnore;
+
public ICollection AllConflictInfo => _assemblyConflicts.Values;
public ICollection AllConflictInfoAsDtos => _assemblyConflicts.Values.ToDtos().ToList();
public DllConflictManager(
DllConflictManagmentOptionsLoader optionsLoader,
DllConflictEventEmitter eventEmitter,
- params string[] assemblyPathFragmentsToIgnore
+ string[]? assemblyPathFragmentsToIgnore = null,
+ string[]? exactAssemblyPathsToIgnore = null
)
{
_optionsLoader = optionsLoader;
_eventEmitter = eventEmitter;
- _assemblyPathFragmentsToIgnore = assemblyPathFragmentsToIgnore;
+ _assemblyPathFragmentsToIgnore = assemblyPathFragmentsToIgnore ?? Array.Empty();
+ _exactAssemblyPathsToIgnore = exactAssemblyPathsToIgnore ?? Array.Empty();
}
///
@@ -99,6 +103,14 @@ HashSet visitedAssemblies
private bool ShouldSkipCheckingConflictBecauseOfAssemblyLocation(Assembly loadedAssembly)
{
+ foreach (var exactPath in _exactAssemblyPathsToIgnore)
+ {
+ if (Path.GetDirectoryName(loadedAssembly.Location) == exactPath)
+ {
+ return true;
+ }
+ }
+
foreach (var pathFragment in _assemblyPathFragmentsToIgnore)
{
if (loadedAssembly.Location.Contains(pathFragment))
diff --git a/ConnectorCore/DllConflictManagement/Serialization/SpeckleNewtonsoftSerializer.cs b/ConnectorCore/DllConflictManagement/Serialization/SpeckleNewtonsoftSerializer.cs
new file mode 100644
index 0000000000..2fffc24bf3
--- /dev/null
+++ b/ConnectorCore/DllConflictManagement/Serialization/SpeckleNewtonsoftSerializer.cs
@@ -0,0 +1,14 @@
+using Speckle.Newtonsoft.Json;
+
+namespace Speckle.DllConflictManagement.Serialization;
+
+public class SpeckleNewtonsoftSerializer : ISerializer
+{
+ public string Serialize(T obj) => JsonConvert.SerializeObject(obj);
+
+ public T Deserialize(string serialized) =>
+ JsonConvert.DeserializeObject(serialized)
+ ?? throw new InvalidOperationException(
+ $"Unable to deserialize the provided JSON into an object of type {typeof(T)}"
+ );
+}
diff --git a/ConnectorCore/DllConflictManagement/Serialization/SystemTextJsonSerializer.cs b/ConnectorCore/DllConflictManagement/Serialization/SystemTextJsonSerializer.cs
deleted file mode 100644
index df8f9ebd0f..0000000000
--- a/ConnectorCore/DllConflictManagement/Serialization/SystemTextJsonSerializer.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using System.Text.Json;
-
-namespace Speckle.DllConflictManagement.Serialization;
-
-///
-/// Just a wrapper around the System.Text.Json serializer. If we decide that we want to switch to newtonsoft
-/// or even something that is not json-based, then we only need to make a new implementation of the ISerializer
-///
-public class SystemTextJsonSerializer : ISerializer
-{
- private readonly JsonSerializerOptions _jsonSerializerOptions = new() { WriteIndented = true };
-
- public string Serialize(T obj) => JsonSerializer.Serialize(obj, _jsonSerializerOptions);
-
- public T Deserialize(string serialized) => JsonSerializer.Deserialize(serialized);
-}
diff --git a/ConnectorRevit/ConnectorRevit/Entry/App.cs b/ConnectorRevit/ConnectorRevit/Entry/App.cs
index 2b7de76678..ce01ed30c7 100644
--- a/ConnectorRevit/ConnectorRevit/Entry/App.cs
+++ b/ConnectorRevit/ConnectorRevit/Entry/App.cs
@@ -31,6 +31,10 @@ public class App : IExternalApplication
public static UIControlledApplication UICtrlApp { get; set; }
private bool _initialized;
+ private static readonly string[] s_assemblyPathFragmentsToIgnore = new string[]
+ {
+ "Microsoft.Net\\assembly\\GAC_MSIL\\"
+ };
public Result OnStartup(UIControlledApplication application)
{
@@ -44,13 +48,19 @@ public Result OnStartup(UIControlledApplication application)
UICtrlApp.ControlledApplication.DocumentOpening += ControlledApplication_DocumentOpening;
DllConflictEventEmitter eventEmitter = new();
- ISerializer serializer = new SystemTextJsonSerializer();
+ ISerializer serializer = new SpeckleNewtonsoftSerializer();
AnalyticsWithoutDependencies analytics = new(eventEmitter, serializer, "Revit", GetRevitVersion());
eventEmitter.OnAction += analytics.TrackEvent;
DllConflictManagmentOptionsLoader optionsLoader = new(serializer, "Revit", GetRevitVersion());
// ignore dll conflicts when dll lives in GAC because they are noisy and not an issue (at least in revit)
- DllConflictManager conflictManager = new(optionsLoader, eventEmitter, "Microsoft.Net\\assembly\\GAC_MSIL\\");
+ DllConflictManager conflictManager =
+ new(
+ optionsLoader,
+ eventEmitter,
+ s_assemblyPathFragmentsToIgnore,
+ new string[] { $"C:\\Program Files\\Autodesk\\Revit {GetRevitVersion()}" }
+ );
RevitDllConflictUserNotifier conflictNotifier = new(conflictManager, eventEmitter);
try