p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional C# 5.0 and .NET 4.5.1 (http://p2p.wrox.com/forumdisplay.php?f=756)
-   -   Code for Chapter 13 "Asynchronous Programming" works with error (http://p2p.wrox.com/showthread.php?t=95147)

arvalon October 22nd, 2015 08:05 AM

Code for Chapter 13 "Asynchronous Programming" works with error
 
I downloaded and ran the solution "AsyncSamples". When you press any button, appear two errors.
Code:

Log Name:      Application
Source:        .NET Runtime
Date:          22.10.2015 14:54:05
Event ID:      1026
Task Category: None
Level:        Error
Keywords:      Classic
User:          N/A
Computer:      Community2015
Description:
Application: AsyncPatterns.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.WebException
Stack:
  at System.Net.WebClient.DownloadDataInternal(System.Uri, System.Net.WebRequest ByRef)
  at System.Net.WebClient.DownloadString(System.Uri)
  at System.Net.WebClient.DownloadString(System.String)
  at Wrox.ProCSharp.Async.MainWindow.OnSearchSync(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
  at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
  at System.Windows.Controls.Primitives.ButtonBase.OnClick()
  at System.Windows.Controls.Button.OnClick()
  at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
  at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
  at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
  at System.Windows.Input.InputManager.ProcessStagingArea()
  at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
  at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
  at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
  at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
  at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
  at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
  at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
  at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
  at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
  at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
  at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
  at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
  at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
  at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
  at System.Windows.Application.RunDispatcher(System.Object)
  at System.Windows.Application.RunInternal(System.Windows.Window)
  at System.Windows.Application.Run(System.Windows.Window)
  at System.Windows.Application.Run()
  at AsyncPatterns.App.Main()

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1026</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-10-22T11:54:05.000000000Z" />
    <EventRecordID>6163</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Community2015</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: AsyncPatterns.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.WebException
Stack:
  at System.Net.WebClient.DownloadDataInternal(System.Uri, System.Net.WebRequest ByRef)
  at System.Net.WebClient.DownloadString(System.Uri)
  at System.Net.WebClient.DownloadString(System.String)
  at Wrox.ProCSharp.Async.MainWindow.OnSearchSync(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
  at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
  at System.Windows.Controls.Primitives.ButtonBase.OnClick()
  at System.Windows.Controls.Button.OnClick()
  at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.UIElement.OnMouseLeftButtonUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject, System.Windows.RoutedEventArgs, System.Windows.RoutedEvent)
  at System.Windows.UIElement.OnMouseUpThunk(System.Object, System.Windows.Input.MouseButtonEventArgs)
  at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate, System.Object)
  at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs)
  at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean)
  at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
  at System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs)
  at System.Windows.Input.InputManager.ProcessStagingArea()
  at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs)
  at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport)
  at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawMouseActions, Int32, Int32, Int32)
  at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr, MS.Internal.Interop.WindowMessage, IntPtr, IntPtr, Boolean ByRef)
  at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
  at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
  at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
  at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
  at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
  at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
  at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
  at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
  at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
  at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
  at System.Windows.Application.RunDispatcher(System.Object)
  at System.Windows.Application.RunInternal(System.Windows.Window)
  at System.Windows.Application.Run(System.Windows.Window)
  at System.Windows.Application.Run()
  at AsyncPatterns.App.Main()
</Data>
  </EventData>
</Event>

and
Code:

Log Name:      Application
Source:        Application Error
Date:          22.10.2015 14:54:05
Event ID:      1000
Task Category: (100)
Level:        Error
Keywords:      Classic
User:          N/A
Computer:      Community2015
Description:
Faulting application name: AsyncPatterns.exe, version: 1.0.0.0, time stamp: 0x5628b8bc
Faulting module name: KERNELBASE.dll, version: 6.3.9600.18007, time stamp: 0x55c4bcfc
Exception code: 0xe0434352
Fault offset: 0x00015b68
Faulting process id: 0xb3c
Faulting application start time: 0x01d10cc04eff729f
Faulting application path: C:\Users\devuser\Documents\Visual Studio 2015\Projects\_wrox\13_Code\AsyncSamples\AsyncPatterns\bin\Debug\AsyncPatterns.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report Id: 9803fb85-78b3-11e5-8267-080027b368ce
Faulting package full name:
Faulting package-relative application ID:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Level>2</Level>
    <Task>100</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2015-10-22T11:54:05.000000000Z" />
    <EventRecordID>6164</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Community2015</Computer>
    <Security />
  </System>
  <EventData>
    <Data>AsyncPatterns.exe</Data>
    <Data>1.0.0.0</Data>
    <Data>5628b8bc</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>6.3.9600.18007</Data>
    <Data>55c4bcfc</Data>
    <Data>e0434352</Data>
    <Data>00015b68</Data>
    <Data>b3c</Data>
    <Data>01d10cc04eff729f</Data>
    <Data>C:\Users\devuser\Documents\Visual Studio 2015\Projects\_wrox\13_Code\AsyncSamples\AsyncPatterns\bin\Debug\AsyncPatterns.exe</Data>
    <Data>C:\Windows\SYSTEM32\KERNELBASE.dll</Data>
    <Data>9803fb85-78b3-11e5-8267-080027b368ce</Data>
    <Data>
    </Data>
    <Data>
    </Data>
  </EventData>
</Event>

Please tell me what I should improve?


All times are GMT -4. The time now is 11:02 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.