Forms Problem EventHandler Dynamo/Revit 2025

Hello everyone, I have a problem updating my dynamo scripts to Revit_2025. My dynamo python node that contains a UI forms. As soon as the form has an event handler (e.g. Click_Button or Dropdown_Change) (self.button.Click += self.submit_button_click) the following error occurs:

“PythonEvaluator.Evaluate operation failed. Constructor on type ‘System.Reflection.Emit.RuntimeTypeBuilder’ not found.”

Any ideas what could be the problem here. and how can I overcome this.

example Code:

My understanding is winforms have issues without the .net support that was changed in Revit 2025 shifting to .net 8. I believe Python Net support is on the way (I assume via a package like IP2.7 was?), but for now forms will have reduced functionality.

I believe data shapes has updated to work in 2025, so maybe browser their code to see how they are dealing with this.

this is a problem with PythonNet2 (which has some dependencies with the Net Framework4.x).
While waiting for PythonNet3 in Dynamo I would advise switching to Ironpython3 (which is compatible with Net 8) to avoid regressing to IronPython2

2 Likes