7

I'm testing a project in visual studio 2012.

When I run my code in x86, Console.Writeline shows up in the output window. However, when I run it in x64, it does not.

I understand I can use System.Diagnostics.Debug instead, but I would really like to understand why Console.Writeline is not working, or if there is a setting somewhere.

Thanks.

Edit: An observation: The Visual Studio hosting process is disabled for both builds. When I enable it, all Console.Writeline messages show up for both x64 and x86. When I disable it again, only the x86 displays Console.Writeline.

Vlad
  • 1,889
  • 17
  • 33
  • 2
    Some info about what happening? Errors or smth? – ChruS Oct 25 '12 at 14:33
  • No errors, normal functionality of the software, just Console.Writeline not showing up in output window. If I clean everything and re-build in x86... it works. When I got back to x64 it doesn't work. Very strange. – Vlad Oct 25 '12 at 14:45
  • +1 Thanks for the hint. For me, enabling the hosting process did the trick, even though i'm still on vs2010. Still, the question remains why that should make the difference. – takrl Nov 19 '12 at 15:18
  • Using VS 2013 and experiencing the same stuff. Makes sense that the hosting process serves as a tunnel from your app to the VS Output window, but no idea where the difference between x86 and x64 comes from – Sebastian Edelmeier Nov 21 '13 at 08:02

2 Answers2

3

There should be no difference between the two. Most likely you have a configuration difference between your x86 and x64 compilation profiles. Check to make sure that you are building a console application in both cases.

shellster
  • 1,091
  • 1
  • 10
  • 21
  • You don't need to be making a console application to use `Console.WriteLine`, if you call it from any project type it *should* show up in the [Output Window](http://msdn.microsoft.com/en-us/library/3hk6fby3.aspx). – Amicable Oct 25 '12 at 14:36
  • This is true, but `Console.WriteLine` _won't_ show up in an application console window if you run the application outside of Visual Studio. Which is what the question was about, as I understood it. – shellster Oct 25 '12 at 14:47
  • Well, both my x64 and x86 builds disable the visual studio hosting process. However, the x86 still displays console messages. If I enable hosting process, the x64 does as well. I am just trying to understand why there difference between unhosted x86 and x64 builds. – Vlad Oct 25 '12 at 15:08
1

Make sure you copy settings from AnyCpu while creating x64. I had a similar problem but once I copied it, it worked fine.

Jack7
  • 1,310
  • 12
  • 16