Skip to content

Commit a12f6db

Browse files
committed
fix for #24 - System.lO.FileNotFoundException:
1 parent 503cf12 commit a12f6db

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

sources/RevitDBExplorer/Application.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Linq;
4+
using System.Reflection;
5+
using System.Runtime.CompilerServices;
46
using System.Threading.Tasks;
57
using System.Windows.Media.Imaging;
68
using Autodesk.Revit.DB;
@@ -29,7 +31,17 @@ public class Application : IExternalApplication, IScriptRunner
2931

3032
public Application()
3133
{
32-
34+
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
35+
}
36+
37+
private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
38+
{
39+
var name = new AssemblyName(args.Name);
40+
if (name.Name == "System.Runtime.CompilerServices.Unsafe")
41+
{
42+
return typeof(Unsafe).Assembly;
43+
}
44+
return null;
3345
}
3446

3547

0 commit comments

Comments
 (0)