.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SourceExpressionException (first chance exception) with sad:XamlDebuggerXmlReader.FileName

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :Windows Application

When I run workflows, if the .xaml has a sad:XamlDebuggerXmlReader.FileName attribute, I get lot (at least 1 by activity with vb expression) of first chance exception in the output windows : A first chance exception of type 'System.Activities.ExpressionParser.SourceExpressionException' occurred in System.Activities.dll

To reproduce it :

- I used the "WF_WCF_Samples\WF\Basic\Expressions\BasicExpressions\CS\Expressions.sln" sample.

- I run the program in debug and all is ok in the output window.

- I open SalaryCalculation.xaml in the designer and save the file (It add a the sad:XamlDebuggerXmlReader.FileName in the .xaml).

- I run again the program in debug and now I see multiples first chance exceptions (when running the workflow by the WorkflowInvoker.Invoke for exemple)

But... I do not always reproduce it. The location of the project / .xaml seem to change something. What I found while debugging is the value in the sad:XamlDebuggerXmlReader.FileName="" with mva:VisualBasic.Settings="Assembly references and imported namespaces serialized as XML namespaces" seem to change something. It seems to always have a "A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll" before the the SourceExpressionException happen. Changing the XamlDebuggerXmlReader.F

View Complete Post

More Related Resource Links

A first chance exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll

I've read a bit about this error and maybe I have nothing to worry about.  BUT ... my simple little app gets 7 of these before it even gets to the first Dim statement in the Class Form1!  I found and followed instructions on how to have the Debugger intercept these exceptions but it seems that they are not being intercepted.  I only know that they have happened because of the messages in the Immediate Window.  In the Designer all I have is 5 Labels and 5 TextBoxes.   Any thoughts on how I could get to the cause of these messages? Thanks,  Bob

A first chance exception of type 'System.Runtime.InteropServices.COMException'


After calling a very simple WCF Service I bind the result an Observable Collection of Countries to WPF ComboBox, in second ComboBox of cities I displayed the filtered cities based on the selected country. It works fine the first time but when I select another country it takes lots of time to display, the Visual Studio 2010 output displays this like 50 times:

A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Intereting to point out that it only happens if I try to open the ComboBox and not if if navigate through code doing something like SelectedIndex=2 . It does not happen as well if instead of the ComboBox I use a ListBox or TreeView.

Some extra details.... the real exception detail is:

An event was unable to invoke any of the subscribers (Exception from HRESULT: 0x80040201)

Please help with this bug....

.NET 4.0 : First-chance exception 0x04242420


I see a 0x4242420 first-chance exception fly by my Output window in the debugger and I wanted to check if this exception was benign. 

The call stack when the exception occurs is as follows:

>	kernel32.dll!_RaiseException@16() + 0x52 bytes 
	clr.dll!Debugger::SendRawEvent() + 0x2f9adc bytes	
	clr.dll!Debugger::RaiseStartupNotification() + 0x48 bytes	
 	clr.dll!Debugger::Startup() + 0x73 bytes	
 	clr.dll!DoAdditionalPEChecks() - 0x439b bytes	
 	clr.dll!EEStartupHelper() + 0x4a9 bytes	
 	clr.dll!EEStartup() + 0x1c bytes	
 	clr.dll!EnsureEEStarted() + 0xa7 bytes	
 	clr.dll!_ClrCreateManagedInstance@12() + 0x41 bytes	
 	webengine4.dll!LegacyActivationShim::ClrCreateManagedInstance() + 0x55 bytes	
 	webengine4.dll!CreateAppDomainFactory() + 0x34 bytes	
 	webengine4.dll!GetAppDomain() + 0x16d3 bytes	
 	webengine4.dll!GetAppDomainIndirect() + 0x15 bytes	
 	aspnet_wp.exe!CAsyncPipeManager::ProcessMessage() + 0x270 bytes	
 	aspnet_wp.exe!CAsyncPipeManager::ProcessCompletion() + 0x2b4 bytes	
 	webengine4.dll!CorThreadPoolCompletionCallback() + 0x2d bytes	
 	clr.dll!ThreadpoolMgr::CompletionPortThreadStart() + 0x18d bytes	
 	clr.dll!ThreadpoolMgr::intermediateThreadProc() + 0x48 byteskernel32.dll!_BaseThreadStart@8() + 0x37 bytes	

Moving from .NET 3.5 to 4.0: A first chance exception of type 'System.AccessViolationException' oc


I'm trying to upgrade my web app from 3.5 to the 4.0 Framework but keep seeing this error when trying to build the solution. The problem is with some code that's in my App_Code directory (that runs on Application_Start), and the error tells me that the class in the App_Code directory is pointing to an older version of the Oracle.DataAccess.Dll... however using Process Explorer I can't see any references to the older DataAccess DLL after updating all references to the newer Oracle DLL

Is there some way to assure the code in my App_Code directory is using the newer version of Oracle.DataAccess? Any suggestions are welcomed. Thanks


Exception de première chance à 0x0aa11001 dans Appli.exe : 0xC0000005: Violation d'accès lors de la


I developpe one application in DotNet C++, I'm stuck in the following error :


Exception de première chance à 0x0aa11001 dans Appli.exe : 0xC0000005: Violation d'accès lors de la lecture de l'emplacement


My application communicates with a device in real time. For that, I use


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

SQL Server 2005 Try and Catch Exception Handling

I'm pretty excited to see that there is some real error handling for T-SQL code in SQL Server 2005. It's pretty painful to have your wonderfully architected .NET solution tainted by less-than-VBScript error handling for stored procedures in the database. The big difference being the addition of TRY..CATCH blocks. Let's take a look:

reader.getordinal("column_may_not_exist") how to catch the exception?



would any body please help me to catch the exception if the column doesnot exist as my table columns are not static.

sometimes its throwing me indexoutofrange exception as the column doesnot exist

thanks for the help guys

Error while using exception handling block el 4.1


Hi Folks,


i am trying to use tyhe exception handling block of Enterprise library 4.1.


I just createda polisy and used IndexOutOfRangeException and added a replace handler and a logging handler to it.

I am using the NotifyRethrow PostHandlingAction to the exception.


During runtime I am getting an exception on the HandleException event, The exception is added below:



Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 42:             catch (Exception ex)
Line 43:             {
Line 44:                 bool reThrow = ExceptionPolicy.HandleException(ex, "ReplacePolicy");
Line 45:         

userprincipal.changepassword throws exception


Hi all,

      userprincipal.changepassword(oldpassword, newpassword);

gives error: that is Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)

but userDirectoryEntry.invoke("ChangePassword", new object[] { oldpassword, newpassword });

      userDirectoryEntry.CommitChanges works fine.

Any one please tell me the reason behind this.

active directory exception unusual behaviour


i have a small problem
i want user names from active directory for an auto completer type of service
the method is always throwing an exception 
"searcher.FindAll()' threw an exception of type 'System.DirectoryServices.DirectoryServicesCOMException' System.DirectoryServices.SearchResultCollection 

"Exception from HRESULT: 0x800AC472"


Am Exporting Data in to Excel File,meanwhile if i open any other Excel file than the excel File on which am exporting data gets opened up Automatically having name Book1.How should i stop these excel file not to get open.In the Error log i get an error message showing " Exception from HRESULT: 0x800AC472" . Need help on these.Thanks in Advance.

WebControls.TableRow throws exception on Add()


I have the following method to strip hidden and user-specified columns from a gridviewrow and return a tablerow. 

    Private Shared Function StripHiddenColumns(ByVal gvRow As GridViewRow, ByVal ColumnsToExclude() As Integer) As TableRow

        Dim row As New TableRow
        Dim i As Integer = 0
            For Each cell As TableCell In gvRow.Cells
                If cell.Visible Then
                    If Not ColumnsToExclude.Contains(i) Then
                    End If
                End If
                i += 1

            Return row
        Catch ex As Exception
            Throw ex
        End Try
    End Function

However, when I run this code and hit the Add method for the TableRow,  I get an InvalidOperationException stating the Collection was modified; enumeration operation may not execute.  I've gotten this exception before, but usually it's because I'm attempting to modify a table that is databound.  This particular one is not, i am creating it.  Can anyone offer any insight? 

Thanks in advance.


CLR Inside Out: Unhandled Exception Processing In The CLR


In this installment of CLR Inside Out Gaurav Khanna explains everything you need to know about unhandled exception processing in the .NET Framework.

Gaurav Khanna

MSDN Magazine September 2008

Enterprise Library: Take Exception To Critical Errors With Custom Application Blocks


Enterprise Library is a collection of application functionality blocks that you can re-use in your application for common functionality you'd otherwise have to write again and again. Here Jay Hilyard explains how to use them.

Jay Hilyard

MSDN Magazine September 2006

Data Points: SQL Server 2005 XML Support, Exception Handling, and More


SQL Server 2005 includes several important improvements to the Transact-SQL (T-SQL) language. One added feature is a new kind of trigger that fires when data definition language (DDL) statements run.

John Papa

MSDN Magazine May 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend