.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 for April, 2010

Error message when you try to use the SharePoint Products and Technologies Wizard: “Exception: System.ArgumentException: Error during encryption or decryption”

Symptoms
Consider the following scenarios:Scenario 1
You install Microsoft Windows SharePoint Services 3.0, and then you install Microsoft Office SharePoint Server 2007. Then, you remove SharePoint Server 2007.Scenario 2
You install Windows SharePoint Services 3.0, and then you use Add or Remove Programs to removeWindows SharePoint Services 3.0. Then, you reinstall Windows SharePoint Services 3.0.Scenario 3
You install Windows SharePoint Services 3.0 in a stand-alone farm environment. You use the SharePoint Products and Technologies Wizard (PsconfigUI.exe) or Psconfig.exe from the command line to leave the stand-alone farm. Then, you use SharePoint Products and Technologies Wizard or Psconfig.exe from the command line to rejoin the farm.In these scenarios, the next time that you try to run the SharePoint Products and Technologies Wizard, you receive an error message that resembles the following:

10/09/2006 14:08:268ERRTask configdb has failed with an unknown exception 10/09/2006 14:08:268ERRException: System.ArgumentException: Error during encryption or decryption. System error code 997.at Microsoft.SharePoint.Administration.SPCredentialManager.DecryptWithMasterKey(Byte[] rgbEncryptedPassphrase)at Microsoft.SharePoint.Administration.SPEncryptedString.GetSecureStringValue()at Microsoft.SharePoint.Administration.SPEncryptedString.get_SecureStringValue()at Microsoft.SharePoint.Administration.SPProcessIdentity.get_SecurePassword()at Microsoft.SharePoint.Administration.SPApplicationPool.Provision()at Microsoft.SharePoint.Administration.SPWebServiceInstance.Provision()at Microsoft.SharePoint.Administration.SPFarm.Join()at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb()at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run()at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
Resolution
This issue occurs if theNetwork Service account is used as thefarm account. In this situation, when you remove Windows SharePoint Services 3.0 from a stand-alone farm, or when you remove SharePoint Server 2007 from aWindows SharePoint Services 3.0 farm environment, the followingregistry subkey that is used to encrypt passwords that are contained in the Windows SharePoint Services 3.0 configuration database (configdb) is deleted:
HKLM\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ FarmAdmin\Therefore, when you try to join a Web application that exists in the configuration database that does not use the Network Service account, the Web application account credentials cannot be decrypted. This occurs because the required registry subkey is deleted.

Error message when you try to use the Microsoft Exchange Server ActiveSync Web Administration tool to delete a partnership or to perform a Remote Wipe operation on a mobile device in Exchange Ser …

Symptoms
When you try to use the Microsoft Exchange Server ActiveSync Web Administration tool to delete a partnership with a mobile device or to perform a Remote Wipe operation on a mobile device, you receive the following error message:

Failed to access user’s Mailbox, verify that the mailbox and user account are enabled and functional.
Server Error in ‘/MobileAdmin’ Application.
——————————————————————————–
The remote server returned an error: (401) Unauthorized.
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 remote server returned an error: (401) Unauthorized.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote server returned an error: (401) Unauthorized.]
System.Net.HttpWebRequest.CheckFinalStatus() +680
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) +74
System.Net.HttpWebRequest.GetRequestStream() +234
Microsoft.Exchange.AirSync.Admin.Mailbox.propFindRequest(String deviceUri) +240
Microsoft.Exchange.AirSync.Admin.Mailbox.getDevices() +194
Microsoft.Exchange.AirSync.Admin.Devices.refreshDevicesTable() +135
Microsoft.Exchange.AirSync.Admin.Devices.Page_Load(Object sender, EventArgs e) +190
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
——————————————————————————–
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
Resolution
This issue occurs if one or both of the following conditions are true:Integrated Windows authentication is not enabled on the Exadmin virtual directory on the mailbox server.
Note In a front-end/back-end (FE/BE) Exchange configuration, this issue occurs if Integrated Windows authentication is not enabled on the Exadmin virtual directory on the back-end server.The MobileAdmin Web application is not running under the ExchangeApplicationPool application pool.

Error message when you try to start the Search service in SharePoint 2007: “An unhandled exception occurred in the user interface”

Symptoms
When you try to start theSearch service in Microsoft Office SharePoint Server 2007, you receive the following error message:

An unhandled exception occurred in the user interface. Exception Information: OSearch (AccountName) In this error message, AccountName is the account name that is used as the Farm Search Service account.
Resolution
This behavior occurs ifyou do not use the “domain_name\user_name” format when enter an account namein the User name field.This field isnext to Farm Search Service Account on the Configure Office SharePoint Server Search Service Settings on server ServerName page.

Error message when you try to save a record in Microsoft Dynamics CRM 4.0: “Object reference not set to an instance of an object”

Symptoms
When you try to save a record in Microsoft Dynamics CRM 4.0, you receive the following error message:

Object reference not set to an instance of an object.If you have enabled platform tracing, you receive an error message that resembles the following:

Application:
MSCRM Error Report:
Error: Exception has been thrown by the target of an invocation.
Error Number: 0×80040265
Error Message: Object reference not set to an instance of an object.
Error Details: Object reference not set to an instance of an object.
Platform.Sdk:
Web Service Plug-in failed in SdkMessageProcessingStepId: {F6D4EBBB-0075-407D-8208-26575BFA39AF}; EntityName: new_businessrules; Stage: 20; MessageName: Create; AssemblyName:
Microsoft.Crm.ObjectModel.MultiCurrencyPlugin, Microsoft.Crm.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.ObjectModel.MultiCurrencyPlugin; Exception:
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Crm.ObjectModel.CalculateBaseMoney.ProcessCalculatedColumns(DynamicEntity entity, BusinessEntity entityPreImage, EntityMetadata entityMetadata, String exchangeRateFieldName, Boolean isCreateOperation, ArrayList unchangedAttributes)
Resolution
This problem occurs because a money attribute is created for the entity. When you do this, Microsoft Dynamics CRM 4.0 creates an exchangerate attribute to work together with the money attribute. The money attribute is published as part of the entity. However, if you delete the money attribute, the exchangerate attribute is not removed. Therefore, when you try to run a Microsoft Dynamics CRM plug-in, the plug-in can find the exchangerate attribute. However, the plug-in cannot find the money attribute.

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.

Error message when you try to restore a Windows SharePoint Services 3.0 Web site: “The site collection could not be restored. Please make sure the content databases are available and have suffici …

Symptoms
When you use the Stsadm.exe command-line tool to try to restore aMicrosoft Windows SharePoint Services 3.0 Web site on a computer that is runningWindows SharePoint Services 3.0, you receive the following error message:

The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space.
Resolution
This issue occurs if the computer that is running Windows SharePoint Services has insufficient free disk space that is available to host the restored Windows SharePoint Services Web site.This issue may also occur if the Windows SharePoint Services database has reached its maximum allowed size.