Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
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 
Sadly this is a poor,misleading and contrived usage of Task.
In task heavy code that won't work, for the simple reason that as soon as and every time one write await the next line is, potentially, on another thread...

i.e. check that out
C#
Task.Factory.StartNew(async () =>
{
    Thread.CurrentThread.Name = "BackgroundJsonLoader_C71B0546796D46A894925EAF6A0CF420";
    Debug.WriteLine(Thread.CurrentThread.Name);
    await Task.Delay(10);
    Debug.WriteLine(Thread.CurrentThread.Name);
});

In fact.. just try that and understand the magnitude of the problem (not my stackoverflow problem, mind you, the problem of tracking task as they go)
C#
    Task.Run(async () =>
    {
        Console.WriteLine("ThreadID: " +Thread.CurrentThread.ManagedThreadId);
        Console.WriteLine("TaskId: " + Task.CurrentId);
        await Task.Delay(10);
        Console.WriteLine("ThreadID: " + Thread.CurrentThread.ManagedThreadId);
        Console.WriteLine("TaskId: " + Task.CurrentId);
    }).Wait();
}
A new .NET Serializer
All in one Menu-Ribbon Bar
Taking over the world since 1371!


modified 28-Apr-18 11:53am.

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 
AnswerRe: Could not find a part of the path c# in Internet explorer Pin
Richard Deeming26-Apr-18 3:14
mveRichard Deeming26-Apr-18 3:14 
Questiondisabling a textbox at intialization in wpf/C# Pin
jhoga25-Apr-18 4:27
jhoga25-Apr-18 4:27 
AnswerRe: disabling a textbox at intialization in wpf/C# Pin
Richard MacCutchan25-Apr-18 5:04
mveRichard MacCutchan25-Apr-18 5:04 
GeneralRe: disabling a textbox at intialization in wpf/C# Pin
jhoga25-Apr-18 5:15
jhoga25-Apr-18 5:15 
GeneralRe: disabling a textbox at intialization in wpf/C# Pin
jhoga25-Apr-18 5:50
jhoga25-Apr-18 5:50 
QuestionHow to delete row(s) from a database view and two of the linked tables? Pin
Member 1378393524-Apr-18 21:58
Member 1378393524-Apr-18 21:58 
AnswerRe: How to delete row(s) from a database view and two of the linked tables? Pin
Richard Deeming25-Apr-18 1:31
mveRichard Deeming25-Apr-18 1:31 
AnswerRe: How to delete row(s) from a database view and two of the linked tables? Pin
Gerry Schmitz25-Apr-18 6:17
mveGerry Schmitz25-Apr-18 6:17 
Questionabsolute-text-location-multiline Pin
Member 1368201324-Apr-18 19:23
Member 1368201324-Apr-18 19:23 

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.