Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

External Terminal / Debug outside the IDE

I'm starting to use Xamarin Studio, and migrating from VS to it, but when I try to run a console application (the unique one loaded at the moment), fails and throws an exception in Console.Clear() (Supposing I can't do that in an integrated debugger), then i thought that one way to solve it was by compiling it and running it, like Visual Studio does, and Debug the application outside the IDE, but I can't figure out how. Could someone tell me how to solve this problem? Thanks.

EDIT: For any reason, it runs in the embedded window when selecting Release, but it can't read input, so it gets stuck.

like image 717
TheCrimulo Avatar asked Jan 10 '16 19:01

TheCrimulo


People also ask

How to debug a code in VS code?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.

How to debug c# code in visual studio code?

To start debugging, select F5, or choose the Debug Target button in the Standard toolbar, or choose the Start Debugging button in the Debug toolbar, or choose Debug > Start Debugging from the menu bar. The app starts and the debugger runs to the line of code where you set the breakpoint.

How to debug with breakpoints visual studio code?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.


2 Answers

You need to set the project option to have it run your console app in an external console:

Visual Studio For Mac:

Project Options / Run / Configurations / Default / Run on external console

Xamarin Studio:

Project Options / Run / General / Run on external console enter image description here

enter image description here

like image 153
SushiHangover Avatar answered Sep 28 '22 01:09

SushiHangover


You can fix this by running your program in a separate console window. It’s easy to do, although you need to follow the steps closely.

The first step is to bring up the project’s options window. You do this by finding your ‘Solution’ panel (normally on the left side of the Visual Studio window), and within that panel you much right-click on the project (this is pointed to by the “1” arrow in the below picture). Once that context menu appears you need to click on “Options”, which may be very close to the bottom)

Right-clicking on project

Once the Project Options window appears, you should click on Run  Configurations  Default (next to the ‘1’ arrow, below), and then check off Run On External Console (next to the ‘2’ arrow, below)

Project Options dialog

Once that’s done you’ll need to click the ‘Ok’ button.

Everything should work fine at this point, but it’s always good to double-check: try running a program that asks you to type something and verify that it’s working correctly.

like image 32
MikeTheTall Avatar answered Sep 28 '22 00:09

MikeTheTall