« Previous Next »

Thread: How do I configure IIS7 for SQL Server data in App_Data path?

Last post 10-29-2009 8:03 PM by BobEricson. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 10-25-2009, 10:52 PM

    • BobEricson
    • Not Ranked
    • Joined on 10-24-2009, 6:52 PM
    • Concord, Ca
    • Posts 4

    How do I configure IIS7 for SQL Server data in App_Data path?

    I have an ASP.NET app running on IIS7 on Windows 7 Pro. This app has SQL Server databases in MDF files located in the App_Data directory of the app. The app runs fine until it tries to read data from the MDF files then I get the following error: “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.”

     

  • 10-26-2009, 7:58 AM In reply to

    • scypior
    • Not Ranked
    • Joined on 10-26-2009, 11:55 AM
    • Posts 2

    Re: How do I configure IIS7 for SQL Server data in App_Data path?

     Hello, I just wanted to hijack the thread, as I've encountered exactly the same problem. The website itself was created on previous system (vista x64). After formating disk, I've created new website using Visual Studio, and copied old files into it.

  • 10-29-2009, 4:34 AM In reply to

    Re: How do I configure IIS7 for SQL Server data in App_Data path?

    Hi,

    Without ASP.NET impersonation, the website run in the security context of the application pool identity. The default Application Pool Identity in IIS 7.5 (Windows 7) changed from NetworkService to AppPoolIdentity.

    You can configure the application pool identity as NetworkService or another user account, then test again.

    Leo Tang
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • 10-29-2009, 5:46 AM In reply to

    • scypior
    • Not Ranked
    • Joined on 10-26-2009, 11:55 AM
    • Posts 2

    Re: How do I configure IIS7 for SQL Server data in App_Data path?

     Thanks, I've fixed it by changing identity to LocalSystem in DefaultAppPool Advanced Settings (and assuring my website is assigned to that pool).

  • 10-29-2009, 8:03 PM In reply to

    • BobEricson
    • Not Ranked
    • Joined on 10-24-2009, 6:52 PM
    • Concord, Ca
    • Posts 4

    Re: How do I configure IIS7 for SQL Server data in App_Data path?

    That fixed it. I've detailed the steps for people like me who don't use IIS Manger very much:

    1. Start IIS
    2. Open Application Pools by clicking on it
    3. Right click on DefaultAppPool and select “Select Application Pool Defaults”
    4. Change “Identity” property to “NetworkService”
    5. Save and exit IIS

    Thank You!

Page 1 of 1 (5 items)
Microsoft Communities