basquang™ on clouds

August 18, 2009

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

Filed under: WCF — basquang @ 11:03 AM

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!


1 Comment »

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

    Comment by Zunaira Sattar — November 21, 2017 @ 2:45 PM | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: