Conditional breakpoint can't be set

Conditional breakpoint can't be set

AGGilliam
Collaborator Collaborator
565 Views
6 Replies
Message 1 of 7

Conditional breakpoint can't be set

AGGilliam
Collaborator
Collaborator

I'm trying to set a breakpoint that checks for a couple of element ids as integers, but now in VisualStudio 2022 it throws an error that the metadata for RevitAPI is invalid. I've tried looking into this and I can only find mention of turning on a compatibility mode which is no longer an option. Any thoughts on what the root issue might be? I've tried cleaning, rebuilding, closing and re-opening, updating, and still getting the same error:

AGGilliam_0-1668013989155.png

 

566 Views
6 Replies
Replies (6)
Message 2 of 7

caroline.gitonga
Autodesk
Autodesk

Hi @AGGilliam ,

Looks like a similar case has been submitted before on the Forum. You may follow the below forum discussion below to see if you can get any insights on the situation.

https://forums.autodesk.com/t5/revit-api-forum/visual-studio-2015-and-net-4-6-1-debugging-problem/td... 

Let me know if this helps.

 

Carol Gitonga, Developer Advocacy and Support, ADN Open
Message 3 of 7

AGGilliam
Collaborator
Collaborator
In that post the solution was to use the Managed Compatibility Mode, which no longer exists. They also mentioned a Module window but I don't have that either.
Message 4 of 7

RPTHOMAS108
Mentor
Mentor

I always find conditional breakpoints a bit hit and miss....

 

I usually just write an 'if' statement in actual code for the condition and put a breakpoint in the middle of it, then I just comment it out. Do you use copy local? That is the other common thing mentioned (not to use it) when it comes to the unknown issues.

Message 5 of 7

AGGilliam
Collaborator
Collaborator
There were a few things set to copy local by default, I set everything to not copy local but I didn't notice a difference. Adding an if statement would work, it's just nice to be able to add/modify a breakpoint rather than recompiling and restarting Revit.
0 Likes
Message 6 of 7

RPTHOMAS108
Mentor
Mentor

You don't have to restart Revit you can usually get away with hot reload button.

 

I find the hot reload button works for most simple changes. Some things you need to restart anyway i.e. if you add using statements or change method signatures etc.

Message 7 of 7

AGGilliam
Collaborator
Collaborator
I still need to do some more research on the hot reload button. I tried using it after making a couple changes and it errored out so I ended up restarting Revit anyway. I'm not sure if there was some sort of set up I missed or if there are just certain scenarios where it doesn't work. It's good to know that it works though, I was looking forward to using it
0 Likes