I got this error running a query that construct a hierarchyid column:
A .NET Framework error occurred during execution of user-defined routine or aggregate &