Zhuangkh / RevitDevTool

A Tool for Revit Development and Debugging
GNU General Public License v3.0
8 stars 4 forks source link

Conflict With Dynamo Revit #1

Closed chuongmep closed 3 years ago

chuongmep commented 3 years ago

I see a error with dynamo revit, can't open dynamo when add your tool. image image

Zhuangkh commented 3 years ago

What version is your Revit and Dynamo?

chuongmep commented 3 years ago

What version is your Revit and Dynamo?

Im working in Revit 2022 with version: Dynamo Core : 2.10.1.3976 Dynamo Revit: 2.10.1.4002

Zhuangkh commented 3 years ago

The problem is here.

https://github.com/Zhuangkh/RevitDevTool/blob/e7a38dc31630e3c587846d1d0084ff2eeba994fa/src/RevitDevTool/Revit/Addin.cs#L56-L72

AssemblyResolve here is processed before Dynamo, but Dynamo will appear many special args, such as "FunctionObject.ds", or args.Name is a full file path (not a general AssemblyName setting).

I'm considering whether it would be better to manually load the assembly dependencies at OnStartup, or to write a more generic AssemblyResolve method.

Do you have any good ideas?

Zhuangkh commented 3 years ago

I found that whether it's Dynamo, pyRevit, or the Rhino plugin, the assembly dependencies are all loaded manually.

So I modified it this way too. https://github.com/Zhuangkh/RevitDevTool/commit/461620d05c66314dc370eb0e10752c49be08ee70

chuongmep commented 3 years ago

The problem is here.

https://github.com/Zhuangkh/RevitDevTool/blob/e7a38dc31630e3c587846d1d0084ff2eeba994fa/src/RevitDevTool/Revit/Addin.cs#L56-L72

AssemblyResolve here is processed before Dynamo, but Dynamo will appear many special args, such as "FunctionObject.ds", or args.Name is a full file path (not a general AssemblyName setting).

I'm considering whether it would be better to manually load the assembly dependencies at OnStartup, or to write a more generic AssemblyResolve method.

Do you have any good ideas? Whether we can change to check with a class same with pyrevit, I have used pyrevit in combination, it works very well with Dynamo inside. https://github.com/eirannejad/pyRevit/blob/b074f295861b617054c2ad1f6071bba50c885181/dev/pyRevitLoader/Source/PyRevitRunnerApplication.cs#L24

Zhuangkh commented 3 years ago

Yes, I have changed to manually loading dependencies.

chuongmep commented 3 years ago

Look good, it working.