.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘type microsoft’

Error message when you try to run a report or upload a report in Microsoft Dynamics CRM: “The request failed with HTTP status 401: Unauthorized” or “Server Error in ‘/’ Application”

Symptoms
Symptom 1When you try to run a report in Microsoft Dynamics CRM 3.0, you receive the following error message:

The request failed with HTTP status 401: Unauthorized.When you try to run a report in Microsoft Dynamics CRM 4.0, you receive the following error message:

An error occurred while trying to add the report to Microsoft Dynamics CRM.
Try this action again.If the problem continues, check the Microsoft Dynamics CRM Community for solutions or contact your organization’s Microsoft Dynamics CRM Administrator.Finally, you can contact Microsoft Support.
Error code:0×80048298
Symptom 2Consider the following scenario in Microsoft Dynamics CRM: You build a custom report by using Microsoft Visual Studio 2003 or by using a similar tool.You try to upload the report to the Microsoft Dynamics CRM system. In this scenario, you receive the following error message:

Server Error in ‘/’ Application. Exception of type Microsoft.Crm.CrmException was thrown. If the DevErrors parameter is enabled, you receive this error messageon the screen.
This error message occurs in some configurations. For example, this error message may occur if the following conditions are true:The following products are installed on the same server:Microsoft SQL ServerSQL Server Reporting Services (SRS)Microsoft Dynamics CRM is installed on a separateserver.
Resolution
This problem occurs because the security account for the CRMAppPool application pool does not have the Publisher for Microsoft Dynamics CRM role in Report Manager.

BUG: “System.Runtime.Serialization.SerializationException” exception if you declare a static local variable in a method of a Visual Basic .NET or Visual Basic 2005 class and try to serialize the …

Symptoms
Microsoft Visual Basic .NET or Microsoft Visual Basic 2005 allows you to declare static local variables inside a method of class. However, if you declare a static local variable in a method of the Visual Basic .NET or Visual Basic 2005 class, and then you try to serialize the object of the class by using BinaryFormatter or SoapFormatter, you receive the following exception during run time:

An unhandled exception of type ‘System.Runtime.Serialization.SerializationException’ occurred in mscorlib.dll
Additional information: The type Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag in Assembly Microsoft.VisualBasic, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not marked as serialized.
Resolution
The common language runtime does not support static variables in methods. When Visual Basic .NET or Visual Basic 2005 compiler compiles your code, it translates this high-level Visual Basic .NET or Visual Basic 2005 code to Microsoft intermediate language (MSIL) code that the common language runtime can understand to give you shared variable functionality. Visual Basic .NET or Visual Basic 2005 uses the Microsoft.VisualBasic.CompilerServices.StaticLocalInitFlag class to provide this functionality. In Visual Basic .NET or in Visual Basic 2005 compiler, the StaticLocalInitFlag is not marked as serialized. Therefore, you receive the exception during run time.

An exception error is generated after you run a Set-AttachmentfilterListConfig command together with the ExceptionConnectors option on an Exchange 2007 SP1-based server

Symptoms
When you run the Set-AttachmentfilterListConfig command together with the -ExceptionConnectors option on an Exchange Server 2007-based server, the command doesnot run successfully. Additionally, an exception is generated.
For example, you may run the following command:
Set-AttachmentfilterListConfig -ExceptionConnectors d18f518a-38e3-4349-9697-bc2ac318461f When you run this command, you receive the following error message:

WARNING: An unexpected error has occurred and debug information is being generated: Unable to cast object of type ‘System.Collections.Generic.List`1[Microsoft.Exchange.Data.Directory.SystemConfiguration.ReceiveConnector]‘ to type ‘Microsoft.Exchange.Data.Directory.SystemConfiguration.ReceiveConnector[]‘. Set-AttachmentfilterListConfig : Unable to cast object of type ‘System.Collections.Generic.List`1[Microsoft.Exchange.Data.Directory.SystemConfiguration.ReceiveConnector]‘ to type ‘Microsoft.Exchange.Data.Directory.SystemConfiguration.ReceiveConnector[]‘. At line:1 char:31 + Set-AttachmentfilterListConfig? <<<< -ExceptionConnectors d18f518a-38e3-4349-9697-bc2ac318461f Additionally, the follow event is logged in the Application log:
Event Type:?Error
Event Source:?MSExchange Common
Event Category:?General
Event ID:?4999
User:??N/A
Computer:?Servername
Description: Watson report about to be sent to dw20.exe for process id: <ID>, with parameters: E12, c-RTL-x86, <version>, powershell, M.E.Management, M.E.M.M.A.SetAttachmentFilterListConfig.InternalProcessRecord, System.InvalidCastException, 4e90, <version>.? ErrorReportingEnabled: False For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Resolution
To resolve this problem, install Update Rollup 2 for Exchange Server 2007 Service Pack 1. For more information about Update Rollup 2 for Exchange Server 2007 Service Pack 1, see the following Exchange Help topic:
Description of Update Rollup 2 for Exchange Server 2007 Service Pack 1 (http://go.microsoft.com/fwlink/?LinkId=152558)For more information about how to install the latest Exchange service pack or update rollup, see the following Exchange Help topic:
How to Obtain the Latest Service Pack or Update Rollup for Exchange 2007(http://go.microsoft.com/fwlink/?LinkId=152570)