C
C#17mo ago
Wicked Cat

❔ visual studio debugger skipping chunks of code

Hello there, when I step through my code with F11, where it's marked in green is where it stops and goes straight to another method entirely, skipping everything inbetween. I've made sure I'm in debug mode, optimize code is unchecked, i've tried restarting, cleaning and rebuilding and nothing seems to work. While running the program normally nothing within the marked foreach statement seems to be working either.
12 Replies
phaseshift
phaseshift17mo ago
that can happen if the bodylist is a 'generator' enumerable what happens if you change node.SelectNodes(...) to nodes.SelectNodes(...).ToList() ? if the whole foreach is skipped, then bodyParts will be empty
Wicked Cat
Wicked CatOP17mo ago
hm, I can't to .ToList() i'm getting "'XmlNodeList' does not contain a definition for 'ToList' and no accessible extension method 'ToList' accepting a first argument of type 'XmlNodeList' could be found (are you missing a using directive or an assembly reference?)"
phaseshift
phaseshift17mo ago
using system.linq
Wicked Cat
Wicked CatOP17mo ago
that's there already ._.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Wicked Cat
Wicked CatOP17mo ago
that's fair, give me a minute lol
Wicked Cat
Wicked CatOP17mo ago
https://github.com/Wicked-Cat/StoryRPG the cropped bit is from BodyFactory
GitHub
GitHub - Wicked-Cat/StoryRPG
Contribute to Wicked-Cat/StoryRPG development by creating an account on GitHub.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Wicked Cat
Wicked CatOP17mo ago
alright so the changes work, but xmlNodesBodyParts's count is 0, I built it the same as the other factory class and those ones work, and the bodies.xml file is built the same from what I can tell so i'm not sure why this is happening.
Unknown User
Unknown User17mo ago
Message Not Public
Sign In & Join Server To View
Wicked Cat
Wicked CatOP17mo ago
noooo not debugging XD but hopefully now I can figure out what's actually going on, so thanks sfor the help 🙂
Accord
Accord17mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server