System.MissingMethodException: Method not found on Autodesk.Revit.UI.IExternalAp

System.MissingMethodException: Method not found on Autodesk.Revit.UI.IExternalAp

Anonymous
Not applicable
2,279 Views
1 Reply
Message 1 of 2

System.MissingMethodException: Method not found on Autodesk.Revit.UI.IExternalAp

Anonymous
Not applicable

I am working on an F# scripting editor similar to RevitPythonShell or pyRevit.

similar to what Matt did here.

 

Since it is a non modal WPF window I try to follow the ExternalEvent pattern to evaluate scripts. On the main addin class that has the IExternalApplication interface I also create some utility members to raise the external event. I created a static member to access the current instance of this addin class.

see addin: https://github.com/goswinr/Seff.Revit/blob/minimal/Addin.fs#L51

Once the addin is running I send a reference (#r @"D:\Git\Seff.Revit\bin\Debug\net472\Seff.Revit.dll") of the currently running addin to Fsharp Interactive.

The static members are visible with the correct signatures but upon using them I get a System.MissingMethodException.

This happens only to members that use the Revit namespace. Members unrelated to Revit work as expected.

 

I also asked on StackOverflow

 

2020-05-27 14_56_31.png2020-05-27 14_57_31.png

 

Other members work fine: 

 

2020-05-27 15_27_31.png

 

 

 

 

 

0 Likes
Accepted solutions (1)
2,280 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I compiled to net462 instead of net472, that solved it.