Dynamo Stopped Selecting DirectShape Elements

Was working through another Windows 10/Revit21 workstation and had the same problem: type initializer exception for ‘Revit.Elements.DirectShape’.

Configuration:
Windows 10 that continually updates itself so it’s hard to know what state it’s in,
OOTB Revit21 >> Dynamo 2.5.

The workstation in question had two user accounts: (1) admin and (2) non-admin. The problem was initially encountered with the non-admin account. Switched over to the admin account and the type initializer exception was not thrown. Weird.

Reinstalled Revit following the AutoDesk instructions located here. Restarted Windows 10. Logged into the previously troubled non-admin account and attempted to select DirectShapes in the Dynamo environment. No type initializer exception. Ditto for the admin account >> didn’t unintentionally migrate the problem >> victory!

Based on background reading it seems like something in the .Net environment in Windows 10 reaches a state where Dynamo causes it to throw an initializer exception during DirectShape selection events. It also seems like Revit reinstallation cures the adverse state. Personally I don’t have enough Windows 10 knowledge to point directly to root cause.

Bottom line: to cure type initializer exception try a Revit reinstallation and Windows restart.

-Jake