App_data - ASPNETDB.MDF

Discussion in 'ASP .Net' started by Mr. X., Oct 20, 2008.

  1. Mr. X.

    Mr. X. Guest

    I have visual studio 2008.
    My site has a plesk on it.

    I want to deploy my project, and save it on the host machine.

    Looking for solution for folowings, please :

    1st solution
    =======
    Should ASPNETDB.MDF is necessary,
    and can I ignore it (How can I do that) ?

    Since the host side trying to make this file automatically.

    2nd solution
    ========

    I tried to make the ASPNET.MDF on my machine,
    but I got a message :
    Cannot make SSPI context.

    I persume this is via security, and I should run SSMS.exe
    (I have SQL-Server 2005 on my machine).
    But where is it ?

    3rd solution
    ========
    Can't just finding somewhere a good ASPNETDB.MDF, and is it the only file.
    After downloading from
    http://www.4shared.com/file/59591680/a5b7abdf/ASPNETDB_TMP.html
    (Which is 10M !!! - A problem too).
    I got the message :

    Failed to generate a user instance of SQL Server due tofailure in retrieving
    the user's local application data path. Pleasemake sure the user has a local
    user profile on the computer. Theconnection will be closed.
    Description: Anunhandled exception occurred during the execution of the
    current webrequest. Please review the stack trace for more information about
    theerror and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException:Failed to generate a
    user instance of SQL Server due to failure inretrieving the user's local
    application data path. Please make sure theuser has a local user profile on
    the computer. The connection will beclosed.

    Source Error:

    An unhandled exception was generated during the execution of
    thecurrent web request. Information regarding the origin and location ofthe
    exception can be identified using the exception stack trace below.




    Thanks :)
     
    Mr. X., Oct 20, 2008
    #1
    1. Advertisements

  2. Mr. X.

    Mr. X. Guest

    4th solution
    ========
    Just finding a good ASPNETDB file somewhere on the internet,
    and put it on my site (The site on 3th solution is not thinking to be good).

    Thanks :)
     
    Mr. X., Oct 20, 2008
    #2
    1. Advertisements

  3. Mr. X.

    sloan Guest

    I would review this:
    http://weblogs.asp.net/scottgu/archive/2005/08/25/423703.aspx


    If your hosting provider doesn't support Sql Express version, then you'll
    need to create a non express database somewhere.

    The MembershipProvider is an ABSTRACT implementation, thus there are several
    backend database choices.
    Express aspnetdb.mdf is the DEFAULT "auto get created" version.

    If you already have membership data in place, you can consider this blog
    entry for transferring data.
    http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!160.entry
     
    sloan, Oct 20, 2008
    #3
  4. Mr. X.

    Mr. X. Guest

    The hosting provider supports Sql Express version,
    But I don't have any reference to sql (yet),
    so I don't understand why when deploying a dot-net application
    (from VS 2008 - VB), I should have ASPNETDB.MDF on the hosting site,
    whether I want it or not (as I sent a post on 3rd solution - it's 10M,
    and I don't know if this is the only file).

    (I see that the site is trying using this file, and create it
    automatically).

    Thanks :)
     
    Mr. X., Oct 20, 2008
    #4
  5. Mr. X.

    sloan Guest

    Google this:
    <remove name="LocalSqlServer"/>

    That might remove the "auto create" mechanism, I'm not sure.

    Basically, when you make a new website, the "auto create" stuff is built in.
    You have to take steps to remove it if you don't want to use the
    MembershipProvider stuff.

    ..........

    Can you clarify what you want as the end result?

    A.. I don't want a aspnetdb.mdf (at all) on the host server.
    B. I want my own version of aspnetdb.mdf on the host server.
    (B2) I want the host server to use Express version as well.


    I'm not sure if you want or don't want to use the MembershipProvider in your
    (final) solution or not.
     
    sloan, Oct 20, 2008
    #5
  6. The SSPI failure has to do with the ASPNET user account not having rights to
    the database. This is common on ISP servers. If you want to get around this
    on the ISP, change your connection string or have the ISP allow ASPNET user
    (which could be a security issue) or use another account and impersonate
    (you will need the ISP's help on this, as well).

    Are you doing Membership?
    If so, use the admin tool and create the database locally.

    To deploy, consider this:
    http://gregorybeamer.spaces.live.com/blog/cns!B036196EAF9B34A8!630.entry
     
    Gregory A. Beamer \(Cowboy\) - MVP, Oct 20, 2008
    #6
  7. Mr. X.

    Mr. X. Guest

    The reason I want to use MemberShipProvider,
    is only because I want my site work, without exception.

    If MemberShipProvider is neccessary to have things work,
    so I will try to learn using it on the hard way.

    I need to put a control system manager,
    that someone should (with user+password) change some text on the site.

    I can have a simple aspx (without using Visual Studio 2008) - I mean by
    notepad,
    and do the all thing by hand (but I insist using the Visual Studio 2008, for
    it's abilties).

    I have found in
    http://www.4shared.com/file/59591680/a5b7abdf/ASPNETDB_TMP.html

    (The simpliest approach is just obtain an empty database, and putting it on
    the hosting site - but where ?)

    the ASPNETDB.MDF and ASPNETDB_LOG.LDF,
    but I don't know : whether version are right,
    whether I should change the name.

    Where can I obtain good files ?

    When I put ASPNETDB.MDF I get another exception
    (so the file is indeed referenced by the hosting site, based on PLESK !!!).

    Before putting the file (ASPNETDB.MDF ):
    ==============================
    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    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.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    SQLExpress database file auto-creation error:


    The connection string specifies a local Sql Server Express instance using a
    database location within the applications App_Data directory. The provider
    attempted to automatically create the application services database because
    the provider determined that the database does not exist. The following
    configuration requirements are necessary to successfully check for existence
    of the application services database and automatically create the
    application services database:


    a.. If the applications App_Data directory does not already exist, the web
    server account must have read and write access to the applications
    directory. This is necessary because the web server account will
    automatically create the App_Data directory if it does not already exist.
    b.. If the applications App_Data directory already exists, the web server
    account only requires read and write access to the applications App_Data
    directory. This is necessary because the web server account will attempt to
    verify that the Sql Server Express database already exists within the
    applications App_Data directory. Revoking read access on the App_Data
    directory from the web server account will prevent the provider from
    correctly determining if the Sql Server Express database already exists.
    This will cause an error when the provider attempts to create a duplicate of
    an already existing database. Write access is required because the web
    server accounts credentials are used when creating the new database.
    c.. Sql Server Express must be installed on the machine.
    d.. The process identity for the web server account must have a local user
    profile. See the readme document for details on how to create a local user
    profile for both machine and domain accounts.


    Source Error:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:

    [SqlException (0x80131904): 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.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection) +800131
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    bulkCopyHandler, TdsParserStateObject stateObj) +1932
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
    enlistOK) +33
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
    timerExpire, SqlConnection owningObject) +172
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
    host, String newPassword, Boolean redirectedUserInstance, SqlConnection
    owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance) +181
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    +173
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection) +133
    System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection
    owningConnection, DbConnectionPoolGroup poolGroup) +27
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection) +47
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.SqlClient.SqlConnection.Open() +111
    System.Web.Management.SqlServices.GetSqlConnection(String server, String
    user, String password, Boolean trusted, String connectionString) +68

    [HttpException (0x80004005): Unable to connect to SQL Server database.]
    System.Web.Management.SqlServices.GetSqlConnection(String server, String
    user, String password, Boolean trusted, String connectionString) +124
    System.Web.Management.SqlServices.SetupApplicationServices(String server,
    String user, String password, Boolean trusted, String connectionString,
    String database, String dbFileName, SqlFeatures features, Boolean install)
    +86
    System.Web.Management.SqlServices.Install(String database, String
    dbFileName, String connectionString) +25
    System.Web.DataAccess.SqlConnectionHelper.CreateMdfFile(String
    fullFileName, String dataDir, String connectionString) +397



    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
    ASP.NET Version:2.0.50727.1433

    After putting the file (ASPNETDB.MDF) :
    =============================
    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.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: 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.

    Source Error:


    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.


    Stack Trace:


    [SqlException (0x80131904): 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.]
    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection) +800131
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj) +186
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
    cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
    bulkCopyHandler, TdsParserStateObject stateObj) +1932
    System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean
    enlistOK) +33
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
    timerExpire, SqlConnection owningObject) +172
    System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
    host, String newPassword, Boolean redirectedUserInstance, SqlConnection
    owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance) +181
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    +173
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection) +133
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30
    System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject) +424
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject) +66
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject) +494
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection) +82
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.SqlClient.SqlConnection.Open() +111
    System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context,
    Boolean revertImpersonate) +84
    System.Web.DataAccess.SqlConnectionHelper.GetConnection(String
    connectionString, Boolean revertImpersonation) +197
    System.Web.Security.SqlMembershipProvider.GetPasswordWithFormat(String
    username, Boolean updateLastLoginActivityDate, Int32& status, String&
    password, Int32& passwordFormat, String& passwordSalt, Int32&
    failedPasswordAttemptCount, Int32& failedPasswordAnswerAttemptCount,
    Boolean& isApproved, DateTime& lastLoginDate, DateTime& lastActivityDate)
    +1121
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
    String password, Boolean updateLastLoginActivityDate, Boolean
    failIfNotApproved, String& salt, Int32& passwordFormat) +105
    System.Web.Security.SqlMembershipProvider.CheckPassword(String username,
    String password, Boolean updateLastLoginActivityDate, Boolean
    failIfNotApproved) +42
    System.Web.Security.SqlMembershipProvider.ValidateUser(String username,
    String password) +83
    System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e)
    +160
    System.Web.UI.WebControls.Login.AttemptLogin() +105
    System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e)
    +99
    System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
    System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +115
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
    +163
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
    eventArgument) +7
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
    sourceControl, String eventArgument) +11
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746





    --------------------------------------------------------------------------------

    Version Information: Microsoft .NET Framework Version:2.0.50727.1433;
    ASP.NET Version:2.0.50727.1433

    =================================================

    ASPNETDB_LOG.LDF make no difference about the exceptions.

    Thanks :)
     
    Mr. X., Oct 21, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.