Grasshopper Component Creation Error Priority: AssemblyPriority

Whenever I create any grasshopper component using the Rhino package in visual studio 2022, this error occurs when starting grasshopper in rhino:

Priority: AssemblyPriority
{
Exception has been thrown by the target of an invocation.
TargetInvocationException
}

The error appears with even the simplest addition component between two numbers.