Good morning,
I hope all of you are well and safe.
I’ve found an error in some of my C# components, regarding to cast objects. When I’m in debugging mode through Visual Studio the node understand what it is a brep, however when the component is loaded, straight to Rhino GH I got the cast error: Invalid cast: Brep > Brep. (image)
I also got the same error cast points.
This problem doesn’t happen all the time.
I think this problem is related with some VS config that I have? any clue would be very much apreciated.
I’m using Visual studio 2019 community
VS Rhino templates for Rhino 6
Rhino 6
I normally have my RhinoCommon as set to do not copy.
May I ask what your output is?
Since it is running through the script fine. you might want to check if there is an error in the SetData, whether a bad brep is being passed possibly or an empty brep?
Yup, as others have said that is probably the problem. You should always have all GH dll’s and the RhinoCommon dll with set local copy to false. If not there will be some confusion of which dll to load at runtime,(because there will be multiple copies in your PC) by CLR and things can go crazy. Once you set their local copy false property to false in VS, clean the solution and rebuild the project.