Performance Profiler Causes XamlParseException

I'm attempting to evaluate the Performance Profiler, and I'm using it on my WPF client application. Whenever I launch a session for my application (whether from within the Performance Profiler application or through the VS Addin), it immediately exits. When I check the Application event log, I see that my application was terminated because of an uncaught XamlParseException. I do not get this exception when I run my application through the VS debugger.

Below is a summary of the relevant event log entries:
Log Name:      Application
Source:        Windows Error Reporting
Date:          11/28/2011 7:43:50 AM
Event ID:      1001
Task Category: None
Level:         Information
Keywords:      Classic
User:          N/A
Computer:      Adam-PC.DAISTAR.com
Description:
Fault bucket 2601062634, type 5
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: shell.exe
P2: 1.0.0.0
P3: 4ecd594e
P4: System.Xaml
P5: 4.0.0.0
P6: 4ba1f6f8
P7: 17f
P8: 56
P9: System.Windows.Markup.XamlParse
P10: 

Attached files:
C:\Users\Adam\AppData\Local\Temp\WERAA6B.tmp.WERInternalMetadata.xml

These files may be available here:
C:\Users\Adam\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_shell.exe_4138a4f3d499a2d136e9bf2a65bae6d91b166cfb_2acab553

Analysis symbol: 
Rechecking for solution: 0
Report Id: 9d3b61b5-19be-11e1-9745-0026832c7136
Report Status: 0
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Windows Error Reporting" />
    <EventID Qualifiers="0">1001</EventID>
    <Level>4</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-11-28T12:43:50.000000000Z" />
    <EventRecordID>21803</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Adam-PC.DAISTAR.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>2601062634</Data>
    <Data>5</Data>
    <Data>CLR20r3</Data>
    <Data>Not available</Data>
    <Data>0</Data>
    <Data>shell.exe</Data>
    <Data>1.0.0.0</Data>
    <Data>4ecd594e</Data>
    <Data>System.Xaml</Data>
    <Data>4.0.0.0</Data>
    <Data>4ba1f6f8</Data>
    <Data>17f</Data>
    <Data>56</Data>
    <Data>System.Windows.Markup.XamlParse</Data>
    <Data>
    </Data>
    <Data>
C:\Users\Adam\AppData\Local\Temp\WERAA6B.tmp.WERInternalMetadata.xml</Data>
    <Data>C:\Users\Adam\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_shell.exe_4138a4f3d499a2d136e9bf2a65bae6d91b166cfb_2acab553</Data>
    <Data>
    </Data>
    <Data>0</Data>
    <Data>9d3b61b5-19be-11e1-9745-0026832c7136</Data>
    <Data>0</Data>
  </EventData>
</Event>

Log Name:      Application
Source:        Application Error
Date:          11/28/2011 7:43:48 AM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      Adam-PC.DAISTAR.com
Description:
Faulting application name: Shell.exe, version: 1.0.0.0, time stamp: 0x4ecd594e
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17651, time stamp: 0x4e211319
Exception code: 0xe0434352
Fault offset: 0x0000b9bc
Faulting process id: 0x2f5c
Faulting application start time: 0x01ccadcb5ed86f85
Faulting application path: C:\DevProjects\CoreApplication\Shell\bin\Debug\Shell.exe
Faulting module path: C:\Windows\syswow64\KERNELBASE.dll
Report Id: 9d3b61b5-19be-11e1-9745-0026832c7136
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="2011-11-28T12:43:48.000000000Z" />
    <EventRecordID>21802</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Adam-PC.DAISTAR.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Shell.exe</Data>
    <Data>1.0.0.0</Data>
    <Data>4ecd594e</Data>
    <Data>KERNELBASE.dll</Data>
    <Data>6.1.7601.17651</Data>
    <Data>4e211319</Data>
    <Data>e0434352</Data>
    <Data>0000b9bc</Data>
    <Data>2f5c</Data>
    <Data>01ccadcb5ed86f85</Data>
    <Data>C:\DevProjects\CoreApplication\Shell\bin\Debug\Shell.exe</Data>
    <Data>C:\Windows\syswow64\KERNELBASE.dll</Data>
    <Data>9d3b61b5-19be-11e1-9745-0026832c7136</Data>
  </EventData>
</Event>

Log Name:      Application
Source:        .NET Runtime
Date:          11/28/2011 7:43:48 AM
Event ID:      1026
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      Adam-PC.DAISTAR.com
Description:
Application: Shell.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
   at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
   at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
   at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
   at System.Windows.Application.LoadComponent(System.Object, System.Uri)
   at Shell.App.InitializeComponent()
   at Shell.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="2011-11-28T12:43:48.000000000Z" />
    <EventRecordID>21801</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Adam-PC.DAISTAR.com</Computer>
    <Security />
  </System>
  <EventData>
    <Data>Application: Shell.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Windows.Markup.XamlParseException
Stack:
   at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
   at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
   at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
   at System.Windows.Application.LoadComponent(System.Object, System.Uri)
   at Shell.App.InitializeComponent()
   at Shell.App.Main()
</Data>
  </EventData>
</Event>

Log Name:      Application
Source:        .NET Runtime
Date:          11/28/2011 7:43:46 AM
Event ID:      1022
Task Category: None
Level:         Information
Keywords:      Classic
User:          DAISTAR\Adam
Computer:      Adam-PC.DAISTAR.com
Description:
.NET Runtime version 4.0.30319.488 - The profiler was loaded successfully.  Profiler CLSID: '{D6E0BA92-3BC3-45ff-B9CC-B4B5AB7190BC}'.  Process ID (decimal): 12124.  Message ID: [0x2507].
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name=".NET Runtime" />
    <EventID Qualifiers="0">1022</EventID>
    <Level>4</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2011-11-28T12:43:46.000000000Z" />
    <EventRecordID>21800</EventRecordID>
    <Channel>Application</Channel>
    <Computer>Adam-PC.DAISTAR.com</Computer>
    <Security UserID="S-1-5-21-1005366479-2623580504-1028747814-1228" />
  </System>
  <EventData>
    <Data>.NET Runtime version 4.0.30319.488 - The profiler was loaded successfully.  Profiler CLSID: '{D6E0BA92-3BC3-45ff-B9CC-B4B5AB7190BC}'.  Process ID (decimal): 12124.  Message ID: [0x2507].</Data>
  </EventData>
</Event>

Comments

  • Can I just check- does this happen with all profiling modes - have you tried sampling mode too?
  • Can I just check- does this happen with all profiling modes - have you tried sampling mode too?

    It does; I've tried all of the modes in the dropdown and they all produce the same error.

    I notice that it lists a FileNotFoundException for System.Windows.Interactivity.dll earlier in the timeline before it lists the XamlParseException shortly before the profiling session terminates. The odd thing is that the assembly is present and installed (and, I'm fairly certain, in the GAC; I'll have to check when I get back to work shortly, though) and the application runs perfectly fine from within the VS debugger.
  • I'd need to see a memory dump to understand exactly what happened. There are a few ways to do this but we have an effective way with minimal configuration needed:

    You can download a small debugger from us if you don't have Windows debugging tools:
    ftp://support.red-gate.com/utilities/AutoDumper.zip

    Extract all files to a directory,

    Run

    Cscript adplus.vbs -crash -pn <name of process>

    (Or you could try

    Cscript adplus.vbs -hang -pn <name of process>)

    If more than one process exists by the same name, you can use -P <pid> instead of -pn (work out which process number to debug using Windows Task Manager)

    This then dumps files to disk on a crash or hang trigger. If the files are very large, I can set up an FTP account so you can upload it to us.
    Or you can often see the exception by loading the dump file in windbg.exe and running "!anaylyze - v")
  • I discovered the issue. While the problem still baffles me, it does not appear to be related to the profiler. When I tried running my application alone (i.e. not attached to the VS debugger or to the profiler), I have the same issue, but the application works fine in the debugger. It has something to do with parsing the XAML in a style file that I've included.

    If anyone is interested in reviewing the problem (again, not related to the profiler), you're welcome to have a look here: http://stackoverflow.com/questions/8299 ... o-debugger

    FWIW, Once I comment out the offending style definitions, the profiler can attach and function normally. Thanks for your help!
Sign In or Register to comment.