WCF and ASP.NET Membership error: An error occurred when verifying security for the message

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments
  • Reading time:3 mins read

System.ServiceModel.Security.MessageSecurityException: An unsecured or incorrect
ly secured fault was received from the other party. See the inner FaultException
for the fault code and detail. —> System.ServiceModel.FaultException: An erro
r occurred when verifying security for the message.
   — End of inner exception stack trace —


I got this error message when deploy and use WCF with ASP.NET Membership over Internet. My WCF service use wsHttpBinding and Security mode = TransportWithMessageCredential. My machine for test are Windows 7, Visual Studio 2008 SP1, SQL Express 2005. I’ve spent more time to looking for solution. After that, It’s worked fine! Here are work around and solutions

Open Event Viewer

Following error was appeared:

Failed to generate a user instance of SQL Server due to failure in retrieving the user’s local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. [CLIENT: <local machine>]


This is the root of problem.


Add following account to SQL Server

– IIS APPPOOL\DefaultAppPool

– Local System

– Local Services

2. Open the Application Pool of your website used.


You see: Identity: ApplicationPoolIdentity (Windows 7 IIS)


3. Change the Identity to one of other account then iisreset


Hope this help!

This Post Has 0 Comments

  1. Zunaira Sattar

    I am facing same issue but it didn’t work for me.

Leave a Reply