views:

301

answers:

1

We were experiencing errors with one of our web methods on a test web server we have. The main error was:

"Access to the path 'E:\websites\Discovery\ProfileService\App_Data' is denied"

Looking further down the stack trace gives a little more info:

"at System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile..."
"at System.Web.DataAccess.SqlConnectionHelper.EnsureSqlExpressDBFile..."
"at System.Web.DataAccess.SqlConnectionHelper.GetConnection..."
"at System.Web.Security.SqlMembershipProvider.GetUser..."
"at System.Web.Security.Membership.GetUser..."
"at System.Web.Security.Membership.GetUser..."

It appeared that the membership provider was trying to find a connection string for a membership call. On failing to find this entry, it tried to create a new local membership database and failed to do this with a permissions error.

We double checked the connection strings and they seemed ok though they were encrypted. We then saved the config with the connection strings section decrypted - the call now worked!

We know that the connection strings were correct because other service methods were working fine. What is even stranger is that some aspects of membership seemed to work with encryption in place.

Has anyone seen this before or know how to make this work with encrypted connection strings?

A: 

In your code, before you make a SQL call are you decrypting the connection strings?

The error from the stack trace is likely that your app doesn't have write permission in that directory.

Eppz
No, ASP does the job off decrypting the connection strings automatically. This works in every other method call except for this one.
Chris Simpson