[Dynamics CRM]出現 ISV 錯誤頁面 : MultipleOrganizationSoapHeaderAuthenticationProvider

  • 2500
  • 0
  • 2011-10-14

CRM 4.0 出現 ISV 錯誤頁面 : MultipleOrganizationSoapHeaderAuthenticationProvider

FW : David Jennaway - Microsoft Dynamics CRM

If you have a custom ASP.Net pages in a virtual directory within the CRM website, the custom pages fail, giving the error:
Microsoft.Crm.WebServices.Crm2007.MultipleOrganizationSoapHeaderAuthenticationProvider, Microsoft.Crm.WebServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' doesn't exist
You can also get the same error when creating a new virtual directory within the CRM website.
The reason for the error is that CRM adds 2 HttpModules (MapOrg and CrmAuthentication) to web.config in the root of the CRM website. The CrmAuthentication HttpModule is in the microsoft.crm.webservices.dll assembly, which is not in the path of the custom virtual directory.
There are two solutions to this. Either:

  1. Ensure microsoft.crm.webservices.dll can be found. To do this, add it to the global assembly cache, then run iisreset (or recycle the CrmAppPool application pool)
  2. Remove the CrmAuthentication HttpModule from the virtual directory. I haven't fully investigated whether this adversely impacts use of the CRM 4.0 web services endpoint, but can be safely done if the ASP >net pages use the CRM 3.0 web services endpoint (or don't access CRM web services at all). To remove the HttpModule, add the following to the web.config in the custom virtual directory (within the system.web element):

<httpModules>
         <remove name ="CrmAuthentication" />
</httpModules>