Resolving “Cannot Create File Mapping” on custom webpage

When I deployed my custom webpage on Windows Server 2008 (64 bit), and accessed it I got an InvalidOperationException with the description “Cannot create file mapping error “. The Microsoft CRM Trace read as follows:

Exception information:
Exception type: TypeInitializationException
Exception message: The type initializer for 'Microsoft.Crm.Authentication.BaseAuthenticationProvider' threw an exception.


[2009-05-11 22:42:33.5] Process: w3wp Organization:00000000-0000-0000-0000-000000000000 Thread: 3 Category: Exception User: 00000000-0000-0000-0000-000000000000 Level: Error CrmPerformanceCounterFactory.LoadCounters
at CrmPerformanceCounterFactory.LoadCounters(PerformanceCounterLoadSetting settings, String component)
at BaseAuthenticationProvider..ctor()
at MultipleOrganizationSoapHeaderAuthenticationProvider..ctor()
at RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
at RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
at RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
at Activator.CreateInstance(Type type, Boolean nonPublic)
at BaseAuthenticationSettings.CreateType(String typeName, Type requiredBaseType)
at BaseAuthenticationSettings.CreateProvider(String typeName, IDictionary`2 configuration)
at AuthenticationPipelineSettings.LoadPipeline()
at AuthenticationPipelineSettings.get_AuthenticationProvider()
at AuthenticationEngine.get__provider()
at AuthenticationEngine.Execute(Object sender, EventArgs e)
at SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at ApplicationStepManager.ResumeSteps(Exception error)
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData)
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
at HttpRuntime.ProcessRequestNoDemand(HttpWorkerRequest wr)
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType)


After much R&D, I found two links that helped in fixing the issue:
1. http://support.microsoft.com/kb/958377

2. https://community.dynamics.com/forums/p/11935/16202.aspx


However, even after I repaired my installation of MS CRM ( as advocated in 1 above), I still had to add the following entries in the authorizedTypes section in the web.config for Microsoft CRM (as advocated in the 2nd link provided above) which finally resolved this issue:

<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System" TypeName="Void" Authorized="True"/>
<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection" TypeName="AssemblyFileVersionAttribute" Authorized="True"/>
<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Reflection" TypeName="AssemblyVersionAttribute" Authorized="True"/>
<!--
* CRM SE 5934 V4: Workflow Designer and Runtime Do Not Handle Decimal Numbers Correctly
-->
<authorizedType Assembly="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Namespace="System.Globalization" TypeName="CultureInfo" Authorized="True"/>


Refreshed my browser window and the custom page rendered just fine!!

Comments

Popular posts from this blog

The key specified to compute a hash value is expired, only active keys are valid.

IFD Implementation for custom web pages and Anonymous Access

Using CRM Services to create or update records in large numbers