help.axcms.net Axinom Logo

KB10057: System.ServiceModel.CommunicationException under the Page Preview

A red Internal Error while accessing a page preview is probably caused by misconfigured WCF.

SYMPTOMS

You are accessing a Page in a preview mode and get a red message "internal error occured".

Important information in this long error message is:

  • It´s a System.ServiceModel.CommunicationException
  • The Argument to the Exception is: NotFound

CAUSE

The cause of the problem is not properly configured/activated WCF support in IIS/IIS Express (WCF stands for Windows Communication Foundation).

Additional error information could be revealed from the IIS log file:

::1, a000b00000c000000d00000e0000000f, 9/23/2009, 12:44:23, W3SVC1, PCDAN02, ::1, 80, 820, 197216, 200, 0, GET, /AxCMSweb_PremiumSample/Imprint_de.AxCMS, URL=/Imprint_de.AxCMS&ActiveID=1072,
::1, -, 9/23/2009, 12:44:23, W3SVC1, PCDAN02, ::1, 1, 1136, 6310, 405, 1, POST, /AxCMSweb_PremiumSample/Concept.svc, -,

So while responding to the Imprint_de.AxCMS request the IIS tries to use the Concept.svc WFC service which fails with a 405 error. Like 404 errors these are just reported to say "not found" while they ought say "not allowed for execution".


SOLUTION FOR IIS 7.x

Open command promt having administrative rights and run these lines of code:

cd \Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation
ServiceModelReg.exe -r -y

It registers WCF with IIS. After IIS restart eveything should work properly.

SOLUTION FOR IIS 6.x

Run ServiceModelReg as described under "Solution for IIS 7.x" above.

Additionally ensure that *.svc file type is mapped to aspnet_isapi.dll

Go To Internet Information Services (IIS) Manager, right click on IIS Web Site - Properties and check ISAPI mappings as shown below:

SOLUTION FOR IIS Express

  • Go to C:\Users\<username>\Documents\IISExpress\config
  • Open applicationhost.config
  • Add the following to <handlers> section as the first handler (important!):

    <add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
    <add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
  • Restart IIS Express (go to WebMatrix and click Stop, then Start buttons in the toolbar)

APPLIES TO

AxCMS.net versions: 9.x and above

IIS version: 6.x, 7.x, IIS Express