Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debug in VS2022
#1
I recall reading that if I want to step-debug and stack trace, I'll need to set up VS.  I use VS for other projects, so that's not a big deal.  I assume I'll need to probably download the entire source code to Au so that I can set stop points?  Or is creating a project with my scripts sufficient?  It's not such a huge deal, as I have been using the "print.it()" method of debugging so far....
#2
Only need VS installed.

Then in script to set a breakpoint click menu Run -> Debug break. It inserts a code line that works like a breakpoint.

Example.

C# code:
// script ""
print.it(1);
if(Debugger.IsAttached) Debugger.Break(); else Debugger.Launch();
print.it(2);
print.it(3);

When the script runs and encounters this code, a dialog will ask whether you want to debug, and you say Yes and select a running or new VS instance. Now you are in VS. At first it may say "source not found", but after several Step Over button clicks it will open the script and step into it.
#3
Awesome. Easy!!!


Forum Jump:


Users browsing this thread: 1 Guest(s)