.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 ‘stack trace’

PRB: Common Proxy Server and Firewall Issues with MapPoint Web Services

Symptoms
MapPoint .NET is a HTTP-based Web service that is delivered over TCP/IP. The operation, connectivity, and performance of MapPoint .NET can be impacted by the proxy server and firewall environment. Client applications access the service through this environment. The following errors are related to the proxy server and firewall issues. This article describes potential solutions for these errors.
You may receive one of the following errors from a client application that is accessing the MapPoint .NET Web service.
Error 1

“The underlying connection was closed: The remote name could not be resolved.” Error 2

“The request failed with HTTP status 502: Proxy Error”Error 3

“The request failed with the error message: – Server Error in ‘/Find-20′ Application.
Request format is unrecognized.
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.InvalidOperationException: Request format is unrecognized.”Error 4

“The request failed with HTTP status 407: Proxy authentication required. 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.Net.WebException: The request failed with HTTP status 407: Proxy authentication required.”
Resolution
Error 1

“The underlying connection was closed: The remote name could not be resolved.” This error typically occurs if the network environment routes traffic through an HTTP proxy server, and the client application cannot read the proxy settings automatically from the registry. The problem is more likely to occur if the Web service client is an ASP.NET web application, because Web applications do not typically run on an interactive user account. Therefore, Web applications do not always have access to the browser proxy settings in the registry.
Error 2

“The request failed with HTTP status 502: Proxy Error”This error may occur if MapPoint .NET is behind a proxy server or a firewall that enforces limits on SOAP packet size, or that has a timeout value that is less that the time it takes for a large request to return. For example, a call to MapPoint .NET to render a map with a large number of pushpins causes a large SOAP packet to be returned, and causes a request that takes longer to process than the timeout value allows. This may cause the request to fail, depending on the proxy and firewall configuration for the network.
Error 3

“The request failed with the error message: – Server Error in ‘/Find-20′ Application.
Request format is unrecognized.
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.InvalidOperationException: Request format is unrecognized.”This error may occur if a proxy or firewall is set to remove unknown headers.
Error 4

“The request failed with HTTP status 407: Proxy authentication required. 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.Net.WebException: The request failed with HTTP status 407: Proxy authentication required.”This error occurs if the proxy server requires authentication from a domain user account. This error typically occurs if the MapPoint .NET client is an ASP.NET application. ASP.NET applications typically run on the security context of a local user account that does not have permissions on the network and proxy server.

Error messages when you use Live Meeting Intranet Portal: “Exception_1013: The Directory Service returned an exception” and “Inner Exception(1): Index was out of range”

Symptoms
When you use Microsoft Live MeetingIntranet Portal, you may receive the following error messages:

Exception_1013: The Directory Service returned an exception

Inner Exception(1): Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: indexThe call stack trace that is generated when this issue occurs may resemble the following call stack trace:

at System.Collections.ArrayList.get_Item(Int32 index)at System.DirectoryServices.ResultPropertyValueCollection.get_Item(Int32 index)at Microsoft. LiveMeeting.DirectoryService.GetDirectoryUser(AuthenticatedUser authUser)at Microsoft.LiveMeeting.Services.GetDirUser(AuthenticatedUser authUser)
Resolution
This issue occurs if you do not use Microsoft ASP.NET version 1.1.4322.
Additionally, this issue may occur if the Live Meeting Intranet Portal virtual directory is not set to use ASP.NET version 1.x.

Error message when you view an activity form in Microsoft Dynamics CRM 4.0: “Exception of type ‘System.Web.HttpUnhandledException’ was thrown”

Symptoms
When you view an activity form in Microsoft Dynamics CRM 4.0, you receive the following error message:

Error: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.Error Message: 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.Error Details: Exception of type ‘System.Web.HttpUnhandledException’ was thrown.Source File: Not availableLine Number: Not availableRequest URL: http://URL
Stack Trace Info: [ArgumentNullException: Key cannot be null.Parameter name: key]at System.Collections.Hashtable.ContainsKey(Object key)at System.Collections.Hashtable.Contains(Object key)at Microsoft.Crm.Metadata.PreloadedMetadataCacheDataProvider.TryGetEntity(String entityName, NameMappingType mapping)at Microsoft.Crm.Metadata.DynamicMetadataCache.GetEntity(String entityName, NameMappingType mapping)at Microsoft.Crm.Security.User.HasPrivilege(IUser user, String entityName, PrivilegeType privilegeType, PrivilegeDepth privilegeDepth)at Microsoft.Crm.Security.User.HasPrivilege(IUser user, String entityName, AccessRights accessRights, PrivilegeDepth privilegeDepth)at Microsoft.Crm.Security.User.HasPrivilege(IUser user, String entityName, AccessRights accessRights)at Microsoft.Crm.Application.Components.Sdk.FormControls.Web.LookupControl.set_LookupTypes(Int32[] value)at Microsoft.Crm.Application.Components.Sdk.FormControls.Web.LookupControl.set_Metadata(AttributeMetadata value)at Microsoft.Crm.Application.ControlActivator.CreateControl(ControlDescriptor controlDescriptor, String clientId)at Microsoft.Crm.Application.Forms.CrudForm.BuildFormModel(FormDescriptor formDescriptor)at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, String formType)at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity)at Microsoft.Crm.Web.Activities.BasicActivityPage.ConfigureForm()at Microsoft.Crm.Web.Activities.PhoneCallDetailPage.ConfigureForm()at Microsoft.Crm.Application.Controls.AppUIPage.OnPreRender(EventArgs e)at System.Web.UI.Control.PreRenderRecursiveInternal()at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Resolution
This problem occurs because the FormDescriptor object caches some entity metadata. Therefore,an ArgumentNullException exception occurs.

Error message when you use the System Center Configuration Manager 2007 Service Pack 1 console to connect to a Configuration Manager 2007 site server that is not running Service Pack 1

Symptoms
Consider the following scenario:You open a System Center Configuration Manager 2007 Service Pack 1 (SP1) consoleand use it toconnect to a site server that is running Configuration Manager 2007 without SP1.You open the Site Settings\Discovery Methods item, and then you double-click the Network Discovery item.In this scenario, you receive the following error message:

AdminUI.Console.dll
MMC has detected an error in a snap-in and will unload it. After you receive this message, you have the following options:Option 1: Report this error to Microsoft, and then shut down Microsoft Management Console (MMC).Option 2: Unload the snap-in. If you select option 2, and then you click OK, you receive the following error message, and the snap-in is shut down:

Unhandled Exception in Managed Code Snap-inFX:{6de537a5-7a1c-4fa4-ac3a-1b6fc1036560}The given key was not present in the dictionary.Exception Type:System.Collections.Generic.KeyNotFoundExceptionException stack trace:at System.ThrowHelper.ThrowKeyNotFoundException()at System.Collections.Generic.Dictionary`2.get_Item(TKey key)at Microsoft.ConfigurationManagement.AdminConsole.NetworkDiscovery.NetworkDiscoveryGeneralControl.UpdateUI()at Microsoft.ConfigurationManagement.AdminConsole.NetworkDiscovery.NetworkDiscoveryGeneralControl.InitializePageControl()at Microsoft.ConfigurationManagement.AdminConsole.SmsPropertyPage.OnInitialize()at Microsoft.ManagementConsole.PropertyPage.InternalInitialize()at Microsoft.ManagementConsole.PropertySheet.ProcessNotificationMessage(PropertyPageNotification pageNotif)at Microsoft.ManagementConsole.SnapInBase.ProcessNotification(Notification notification)at Microsoft.ManagementConsole.NamespaceSnapInBase.ProcessNotification(Notification notif)at Microsoft.ManagementConsole.Internal.SnapInClient.Microsoft.ManagementConsole.Internal.IMessageClient.ProcessNotification(Notification notification)at Microsoft.ManagementConsole.Internal.IMessageClient.ProcessNotification(Notification notification)at Microsoft.ManagementConsole.Executive.SnapInNotificationOperation.ProcessNotification()at Microsoft.ManagementConsole.Executive.Operation.OnThreadTransfer(SimpleOperationCallback callback)
Resolution
The Configuration Manager 2007 SP1 console assumes that site servers have Active Management Technology (AMT) discovery information. However, such information is available only from site servers that are running Configuration Manager 2007 with SP1. When you try to obtain this information from a site server that is running without SP1, this issue occurs.

BUG: A Client That Is Linked with the Soapsuds Proxy DLL Throws a Remoting Exception at Run Time

Symptoms
When a client is linked with the proxy DLL that the Soapsuds tool (Soapsuds.exe) generates, the client throws a remoting exception atrun time. You may receive an error message that is similar to thefollowing error message:

Unhandled Exception: System.Runtime.Remoting.RemotingException:Permission denied for activating type soap:TestClass,http://schemas.microsoft.com/clr/nsassem/EchoExeTest/ServerExe%2C%20Version%3D0.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull.Server stack trace: atSystem.Runtime.Remoting.Activation.ActivationListener.Activate(IConstructionCallMessagectorMsg) atSystem.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(MethodBasemb, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext,Object[]& outArgs) atSystem.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessagemsg, Int32 methodPtr, Boolean fExecuteInContext)
Resolution
To work around this problem by linking the client, followthese steps:Run the Remoting Server application, and then generate theproxy by using the following command:

soapsuds -url:<ServerUrl?wsdl> -oa:serverexe.dllRun the remoting server.Generate the proxy code by using the following command:

soapsuds -url:<ServerUrl?wsdl> -gcOpen the .cs file that Soapsuds.exe generates,remove the SoapType attribute from the class, and then build the proxy.Link the proxy to the client, and then runSoapsuds.exe.
Note If the remoting server is not running, Soapsuds.exe generates anerror and does not generate the proxy code.

Authentication may fail with “401.3″ Error if Web site’s “Host Header” differs from server’s NetBIOS name

Symptoms
When you are using Internet Explorer on a Windows 2000 or later client and browsing to a Web site where the host header name is different from the NetBIOS name of the computer, Integrated Authentication may fail with an HTTP error 401.1, error 401.2, orerror 401.3.
NoteInternet Explorer clients that are using Windows NT 4 or Windows 95 or Windows 98 will not fail. Also, other authentication schemes will work.
Microsoft ASP.NET users may see an error message that is similar to the following:

Server Error in ‘<application name>’ Application.
Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.
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.Data.SqlClient.SqlException: Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.
Resolution
During Kerberos authentication, a domain controller that is running Windows 2000 or Windows Server 2003grants tickets based on the Server Principle Name (SPN) of the Internet Information Services (IIS) Web server.If the host header (Web site name) being requested differs from the NetBIOS name of the IIS 5.0 computer, Kerberos authentication will fail, causing 401.3 errors on the client.
Clients using Windows NT 4 or Windows 95 or Windows 98 succeed because they do not natively support Kerberos and thus use Windows NT Challenge/Response (NTLM) authentication.