Is it possible to debug a xmlport?

Debugging with VSC works when I trigger an action in the user interface for example, but the program doesn’t stop at the breakpoint when it gets triggered by a request sent to a xmlport.

I also tried to use the Message and Dialog functions to output a property for example, but didn’t get it to work.

So is it possible to debug xmlports with Visual Studio Code at all? How is it done?

Best regards

Yes, it is possible to debug xmlports with Visual Studio Code. Here are some steps you can follow to do so:

  1. Open the xmlport you want to debug in Visual Studio Code.
  2. Set a breakpoint on the line of code where you want to start debugging.
  3. Run the xmlport in Business Central.
  4. When the xmlport is triggered by a request, Visual Studio Code should stop at the breakpoint.
  5. You can now use the debugger to step through the code and inspect variables.

If you are having trouble getting the Message and Dialog functions to output a property, you may need to check that you have the correct permissions to use these functions in Business Central.