Visual Studio Community 2015 application consolidation error on startup

Here are the errors:

'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\14.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\Users\Chris James\Documents\Visual Studio 2015\Projects\ConsoleApplication3\ConsoleApplication3\bin\Debug\ConsoleApplication3.vshost.exe'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. The thread 0x3344 has exited with code 0 (0x0). The thread 0x369c has exited with code 0 (0x0). The thread 0x4498 has exited with code 0 (0x0). 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'c:\users\chris james\documents\visual studio 2015\Projects\ConsoleApplication3\ConsoleApplication3\bin\Debug\ConsoleApplication3.exe'. Symbols loaded. 'ConsoleApplication3.vshost.exe' (CLR v4.0.30319: ConsoleApplication3.vshost.exe): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'. Symbols loaded. The thread 0x2b58 has exited with code 0 (0x0). The thread 0x3994 has exited with code 0 (0x0). The program '[11144] ConsoleApplication3.vshost.exe' has exited with code 0 (0x0). 

I see the console using ctrl + f5, which I recognized due to another question, but it starts and disappears when Start is just used. Visual Studio terminates my console application too quickly

This is my first C # program for event driven programming. I was wondering if I should worry about future programs or can I get around it every time? I also enabled Symbols through Debug>Options>Debugging>Symbols , which changed my error from a file not found for the symbol loaded. Is there a better solution? I uninstalled, reinstalled, repaired, disposed of the redistributable resources, and added the older redistributable components, but could not find another solution. Any help is appreciated.

Here is the code.

 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DelegateTutorial1 { public class MediaStorage { public delegate int PlayMedia(); public void ReportResult(PlayMedia playerDelegate) { if (playerDelegate() == 0) { Console.WriteLine("Media played successfully"); } else { Console.WriteLine("Media did not play successfully"); } } } public class AudioPlayer { private int audioPlayerStatus; public int PlayAudioFile() { Console.WriteLine("Simulating playing an audio file"); audioPlayerStatus = 0; return audioPlayerStatus; } } public class VideoPlayer { private int videoPlayerStatus; public int PlayVideoFile() { Console.WriteLine("Simulating a failed video file"); videoPlayerStatus = -1; return videoPlayerStatus; } } public class Tester { public void Run() { MediaStorage myMediaStorage = new MediaStorage(); AudioPlayer myAudioPlayer = new AudioPlayer(); VideoPlayer myVideoPlayer = new VideoPlayer(); MediaStorage.PlayMedia audioPlayerDelegate = new MediaStorage.PlayMedia(myAudioPlayer.PlayAudioFile); MediaStorage.PlayMedia videoPlayerDelegate = new MediaStorage.PlayMedia(myVideoPlayer.PlayVideoFile); myMediaStorage.ReportResult(audioPlayerDelegate); myMediaStorage.ReportResult(videoPlayerDelegate); } } class Program { static void Main(string[] args) { Tester t = new Tester(); t.Run(); } } } 
+5
source share
1 answer

That is not a mistake at all, that is the usual beavor.

If you start the console application, a new console window is displayed and it will remain open while your process is running. After your process exits, the console window will be closed.

If you enter Console.ReadKey() at the end of the application, the window will remain open until you press a key.

So change this ...

 static void Main(string[] args) { Tester t = new Tester(); t.Run(); } 

... to that...

 static void Main(string[] args) { Tester t = new Tester(); t.Run(); Console.ReadKey(); } 

... and the console window will remain open until you press any key.

In addition : the characters you include will help you if you want to debug in the .NET framework. This has nothing to do with the fact that terminating the console application will close the console window.

+3
source

Source: https://habr.com/ru/post/1242257/


All Articles