How to get Xamarin Studio C# output within the IDE? - c#

I recently started experimenting with Xamarin and Mono C# on my Mac. I am used to working on Windows with Visual Studio so I find it cumbersome when every time I run my console application, a new terminal window and mono compiler terminal open up. And I have to manually close them. Is there anyway to get the output of my programs from a window or pane inside the IDE ? Or is there anyway to set it up so only one terminal window shows up ?

If you open the Project Options there is a Run on external console check box in the Run - General category which controls this behaviour. If you uncheck this option when you run a console application the output will be shown in an Application Output window inside Xamarin Studio and no external console window will be opened.

For anyone else arriving at this question who can't locate 'Project Options', the item is found in a drop down menu under the Project Tab (located at the top of the screen on the app's main nav bar). When a solution/file is loaded, the item is listed with your project's actual name, ex: 'MyProject Options' or 'MyProject&Options' (–it does not literally read 'Project Options').

Related

Visual Studio Setup Project User Desktop Shortcut icon doesn't work... why?

I developed a VS Setup Project with many Projects Output. I added 3 desktop shortcuts to my project outputs and I attached the .exe icon to the shortcut. After run the setup, I can see only one icon and the other 2 icons are the application default icon as showed in my desktop shortcut.
The only one difference to the icons are the size: the first one correctly showed is 128x128, the other 2 are 512x512 but if I open the Debug folder in the App Project the icon look very well.
Does VS Setup project have a limitation for icons??
I created a demo using Visual Studio Installer Project.
I used two icons, one 128x128 and one 669x512. Both can be displayed correctly.
One of the icons I used had an error during the test and couldn't run. (The reason for my error is that there is an error in the icon file, so it cannot be displayed correctly. It is recommended that you check your icon file)

C# code works but errors occur while packaging my UWP application in Visual Studio 2017

I have created a UWP application in Visual Studio. I plan on using it only for side loading(it is a LOB app). It doesn't have any errors. But when I try to package it, I get the following errors.
Errors in Packaging
0X8007000b an attempt was made to load a program with an incorrect format
Also, here is my output console.
How do I fix this?
From the solution explorer, double click and open Package.appxmanifest
Click on Visual Assets tab on top. It is second from left, after Application tab.
Select a source image (this is the image you want to use for logos, badges, splash screen, etc.)
Under assets combo box, select all All Visual Assets
Hit Generate
Say ok that it will overwrite your existing files
Now, if you want to use a different image for any of the specific areas, for example, App Icon, scroll down, and provide a different source for it.
Now, build and make sure your app builds. Then attempt to create the app package again.

Debugging c# in Xamarin or Visual Studio (preview) for mac [duplicate]

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.
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
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)
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)
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.

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.
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
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)
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)
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.

watch console output panel in visual studio while running a XNA game

I'm a visual studio newbie, currently developing a game using VS 2010 express, C# and XNA 4.0 .
I'm trying to debug a little game I'm developing, using a Console.WriteLine call when a certain event occur. Unfortunately when I execute the program the visual studio layout changes and the output panel disappear until the program exits (so I can analyze the output only after the program ends).
I would like to know if it possible and how, to keep the output panel visible.
Whilst in Debug mode, simply show it again by going to View->Output
2 things:
I output my debug stuff in xna4.0 with
System.Diagnostic.Debug.WriteLine("stuff");
To view output just go to View -> Output or Alt+2
If you found this question through a search and you do not see the Output Window under the "View" menu, it is most likely because you are viewing Visual C# 2010 under 'Basic Settings.' Under basic settings, you can find the output menu as follows:
Debug -> Windows -> Output
If you want to get out of basic settings, you can change as well:
Tools > Settings > Expert Settings
And then you will be able to access the Output Window as described in the other answers.

Categories