I want to use a conditional breakpoint to break when a variable of type Guid has a particular value.
I know how to add a conditional breakpoint. I've tried to write a condition like this:
departmentId == new Guid("MYGUIDHERE")
But this does not work, it doesn't break. Can anyone tell me how to do this properly?
I have tried setting the conditional break point as you did, but it shows the error:
I guess that action is not supported. So, the alternative way should be:
departmentId.ToString() == "MYGUIDHERE"
In my example, the expression would be:
deptId.ToString() == "ca761232-ed42-11ce-bacd-00aa0057b223"
Another way is using Guid.Parse(string) , like this:
deptId == Guid.Parse("ca761232-ed42-11ce-bacd-00aa0057b223")
如果departmentId是Guid类型。
departmentId.toString() == "your guid"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.