Page 1 of 1
[DebuggerStepThrough]
Posted: Thu Aug 04, 2022 12:57 pm
by ic2
I thought I asked this before but can't find it back.
If we want during debugging that a certain method is skipped (when e.g. step is chosen) I thought in VS you should add:
[DebuggerStepThrough]
just above the method/function.
This works in C#.
However, in X# I get Error XS9002 Parser: unexpected CRLF, are you missing a token ?
I tried it with an extra empty line after it, with and without a ; but no luck.
What should it be?
Dick
[DebuggerStepThrough]
Posted: Thu Aug 04, 2022 2:07 pm
by Chris
Hi Dick,
You just need a ";" between the attribute and the method declaration, and no empty lines in between. Just as if it was a single statement.
[DebuggerStepThrough]
Posted: Thu Aug 04, 2022 3:50 pm
by FdeRaadt
Code: Select all
[DebuggerStepThrough];
Function DBG(cString as string) as void pascal
Error XS0246 The type or namespace name 'DebuggerStepThroughAttribute' could not be found (are you missing a using directive or an assembly reference?)
Which reference do you need to use this?
I assumed it is covered by Xsharp.RT but I still have this error
[DebuggerStepThrough]
Posted: Thu Aug 04, 2022 7:25 pm
by robert
Frank
System.Diagnostics
Robert
[DebuggerStepThrough]
Posted: Thu Aug 04, 2022 9:51 pm
by Chris
...that is, you need a USING System.Diagnostics statement. The dll it is contained in is the most standard library that is referenced automatically by all projects (mscorlib.dll), so no need to add any additional reference.
https://docs.microsoft.com/en-us/dotnet ... mework-4.8
[DebuggerStepThrough]
Posted: Fri Aug 05, 2022 8:24 am
by FdeRaadt
Code: Select all
using System.Diagnostics
[DebuggerStepThrough];
Function etc
It seems like I was missing the USING System.Diagnostics Statement.
It works now
Thanks a lot!
Frank