Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd27-Apr-18 3:50
Super Lloyd27-Apr-18 3:50 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Pete O'Hanlon27-Apr-18 21:34
mvePete O'Hanlon27-Apr-18 21:34 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd27-Apr-18 23:47
Super Lloyd27-Apr-18 23:47 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
BillWoodruff27-Apr-18 18:45
professionalBillWoodruff27-Apr-18 18:45 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd27-Apr-18 23:49
Super Lloyd27-Apr-18 23:49 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 0:01
professionalEddy Vluggen28-Apr-18 0:01 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 0:41
Super Lloyd28-Apr-18 0:41 
SuggestionRe: UWP / VisualStudio 2017 and StackOverflowException PinPopular
Eddy Vluggen28-Apr-18 1:07
professionalEddy Vluggen28-Apr-18 1:07 
Sure it works. Windows hasn't been changed that much.
C#
static class Program
{
    /// <summary>
    /// The main entry point for the application.
    ///   (For those confused about it)
    /// </summary>
    [STAThread]
    static void Main()
    {
        Thread.CurrentThread.Name = String.Format("Main UI thread for", Application.ProductName);

        Task BackgroundJsonLoader = Task.Factory.StartNew(() =>
        {
            Thread.CurrentThread.Name = "BackgroundJsonLoader_C71B0546796D46A894925EAF6A0CF420";
            Debug.WriteLine(Thread.CurrentThread.Name);
            Debugger.Break();
        });
When the debugger breaks, go the menu and select from "Debug" the submenu "Windows", the item "Threads" (Ctrl-D, T). You'll now have a list of all active threads. The named ones were created by you, in code. That gives us not just the advantage that we now can identify any thread or task by name, we can also see whether we spawned it or some third-party library.

Very easy to do, rarely ever done. The reason I added a GUID in there is to locate it quickly, as it is always my first line of code on the start of each thread or task.


--Downloading 2017 Community Edition now, will try it on a UWP app once the download is done Thumbs Up | :thumbsup:
Bastard Programmer from Hell Suspicious | :suss:
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.


modified 28-Apr-18 7:28am.

GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Richard MacCutchan28-Apr-18 1:48
mveRichard MacCutchan28-Apr-18 1:48 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 1:51
professionalEddy Vluggen28-Apr-18 1:51 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 4:48
Super Lloyd28-Apr-18 4:48 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 4:59
professionalEddy Vluggen28-Apr-18 4:59 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:47
Super Lloyd28-Apr-18 5:47 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
BillWoodruff28-Apr-18 4:55
professionalBillWoodruff28-Apr-18 4:55 
JokeRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 5:01
professionalEddy Vluggen28-Apr-18 5:01 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:45
Super Lloyd28-Apr-18 5:45 
AnswerRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 5:38
Super Lloyd28-Apr-18 5:38 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen28-Apr-18 6:14
professionalEddy Vluggen28-Apr-18 6:14 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Super Lloyd28-Apr-18 15:56
Super Lloyd28-Apr-18 15:56 
GeneralRe: UWP / VisualStudio 2017 and StackOverflowException Pin
Eddy Vluggen29-Apr-18 0:29
professionalEddy Vluggen29-Apr-18 0:29 
QuestionSend data to remote server using TCPClient Pin
Carmen_Mundi26-Apr-18 8:07
Carmen_Mundi26-Apr-18 8:07 
AnswerRe: Send data to remote server using TCPClient Pin
Richard Deeming26-Apr-18 8:21
mveRichard Deeming26-Apr-18 8:21 
GeneralRe: Send data to remote server using TCPClient Pin
Carmen_Mundi26-Apr-18 8:55
Carmen_Mundi26-Apr-18 8:55 
GeneralRe: Send data to remote server using TCPClient Pin
Gerry Schmitz26-Apr-18 10:25
mveGerry Schmitz26-Apr-18 10:25 
QuestionCould not find a part of the path c# in Internet explorer Pin
Member 1204569226-Apr-18 1:29
Member 1204569226-Apr-18 1:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.