.NET Daily

Recommended Resources


Popular Content


Navigation
CategoryCommon .NET Exceptions
Featured

Common .NET Exceptions

How to solve: An expression tree may not contain a dynamic operation – ASP.NET Core

Posted on July 6th, 2019.

This type of exception usually happens when you forget to declare in the view the model that you plan to use. In the code of the view, you will see the attributes underlined with a red line, as on the picture from below: The solution for this issue is to specify at the top of the page the model you plan to use: @model TestApp.Models.User

Featured

Common .NET Exceptions

Nhibernate Exception: Named Query Not Found: storedproceduremaname

Posted on November 14th, 2012.

Nhibernate Exception: Named Query Not Found: storedproceduremaname Scenario 1: You call a WCF service method to populate a repeater and at page load you are prompted with the above exception. Resolution for Scenario 1: The above exception appears when Nhibernate doesn’t recognize the entity that you want to call. It could be...

Featured

Common .NET Exceptions

.NET Exception: For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server…

Posted on November 7th, 2012.

Exception: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as...

Featured

Common .NET Exceptions

Cannot implicitly convert type ‘System.Data.Linq.Binary’ to ‘byte[]’

Posted on February 4th, 2012.

Error: Cannot implicitly convert type ‘System.Data.Linq.Binary’ to ‘byte[]’ Scenario 1: You have created an sql table in the database with a field of type “byte[]”. Then you have imported that table in a .dbml file. When you try to use the mapped object in code, you get the error above. Cause of...

Featured

Common .NET Exceptions

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Posted on November 25th, 2011.

Error: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. Scenario1: You have created a repeater or gridview that looks like this:                                                                 First Name                                                       Last Name...

Featured

Common .NET Exceptions

__doPostBack not trigger the Button Click event

Posted on September 1st, 2011.

Problem 1: You call __doPostBack javascript function to trigger a click event of a button but the event is not executed although Page_Load event is triggered; Resoulution of Problem 1: You probably used something like this: __doPostBack('<%=btnButton.ClientID %>', ""); Instead, you should use something like this:...

Featured

Common .NET Exceptions

‘MethodName’ is an ambiguous reference between ‘namespace1’ and ‘namespace2’

Posted on August 18th, 2011.

Error: ‘MethodName’ is an ambiguous reference between ‘namespace1’ and ‘namespace2’. Scenario1: Well, this is simple, you have the same method name in both ‘namespace1’ and ‘namespace2’. Cause of Scenario 1: When you add namespace references that contains the same method name...

Featured

Common .NET Exceptions

Failed to load ViewState. The control tree into which ViewState is being loaded must match the control tree…

Posted on July 20th, 2011.

Error: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial...

Featured

Common .NET Exceptions

The target “ControlID” for the callback could not be found or did not implement ICallbackEventHandler

Posted on June 20th, 2011.

Error: The target “ControlID” for the callback could not be found or did not implement ICallbackEventHandler. Scenario 1: You try to dynamically add web controls to a ContentPlaceholder or Panel and on a postback of the page caused by triggering an event from the web control, you get the error. Cause of Scenario 1: When the...