SessionMode.NotAllowed Service Contract Attribute Causes Guest Application Promotion to Fail


It was identified that WCF services being deployed on Apprenda cannot have SessionMode.NotAllowed as a service contract as this causes the promotion and deployment of the component to fail.


During promotion of a service that has this particular attribute enabled, the following error messages will be thrown by Apprenda

Developer Portal

Staging Results -

Error: The service Service1.Service started and stopped successfully but did not properly communicate with the platform. Contact your administrator for additional assistance.



An error occurred while creating the service host for 50c8e5fc-3559-e411-93fd-00155d036e03

-----------------SurfaceException (System.InvalidOperationException)-----------------
Contract does not allow Session, but Binding 'NetTcpBinding' does not support Datagram or is not configured properly to support it.
   at System.ServiceModel.Description.DispatcherBuilder.BuildChannelListener(StuffPerListenUriInfo stuff, ServiceHostBase serviceHost, Uri listenUri, ListenUriMode listenUriMode, Boolean supportContextSession, IChannelListener& result)
   at System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost)
   at System.ServiceModel.ServiceHostBase.InitializeRuntime()
   at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at Apprenda.SaaSGrid.SMART.Bootstrap.BootstrapHostDaemon.<>c__DisplayClass7.b__4()
   at Apprenda.Utility.RetryLoop.Loop(Int32 count, Nullable`1 delay, Boolean randomSleep)




At deploy time, Apprenda reconfigures the WCF service and its endpoints to allow for seamless load balancing, multi-tenancy, security, etc. The protocol used by Apprenda at runtime is net.tcp which is sessionful.


As of Apprenda 5.5, the only way to resolve the issue is to not use this particular attribute as part of the service contract.

Have more questions? Submit a request