2

So I spend almost all of my programming time on Linux, but recently, for a project, I had to try out PTVS and WPF. As it is a very good framework, I would like to learn it further, but the issue in question is a huge disadvantage when compared to running python programs on Linux. So say I have a little WPF project on IronPython2.7, with some buttons and some functions handling those buttons' click events. The problem is that not every exception/error present in that code is shown in debugger: sometimes it just says "the process exited with code 0x01". That, for example, happens if I try to access an array element outside of array bounds. The question is: is there a way to fix this and be able to see all the errors and exceptions while debugging a WPF program?

2
  • Grab the IronPython sources and improve it to throw the correct error in you context? Commented Nov 24, 2016 at 9:42
  • @pix well it's a solution, but obviously not a simple one)) Commented Nov 24, 2016 at 10:18

1 Answer 1

2

By default, IronPython projects in Visual Studio run using the managed debugger. This makes it really easy to debug mixed Python/.NET code, however, you don't get quite as nice an experience when you only have Python code.

To change this, right-click your project in Solution Explorer and select Properties. On the Debug tab, there's a dropdown for the launcher - you can see a screenshot here.

It's probably got IronPython (.NET) launcher selected, but changing it to Standard Python launcher should give you better pure-Python debugging. The downside is that you won't be able to step into .NET code anymore, and it's a little bit more invasive. In general though, the improvements are worth it if you are not using IronPython to extend a .NET application.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much! I'll check that out a little later and mark your answer as the solution if everything works :)
Thanks for the answer, it really helped to tweak the project debug settings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.