problem on deployment : app_data. - newbie question.

Last post 10-20-2008 2:10 PM by jeff@zina.com. 4 replies.

Sort Posts:

  • problem on deployment : app_data. - newbie question.

    10-16-2008, 6:18 PM
    • Member
      point Member
    • eitanmiz
    • Member since 10-16-2008, 9:57 PM
    • Posts 12

    Hello,

    I am trying to deploy my project.

    I have created an app_data folder on the hosting machine (full control).

    Hosting machine has :

    PLESK 8.3.0,

    ConnectionString for LocalSqlServer : data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true

    asp.net version 2.0.50727.0

     

    I have Visual Studio 2008.

     

    After do publishing 

    and  copy the relevant code.

    I get to an error (which seems to be building the ASPNETDB.MDF database file automatically),

    and then I get the error :

    Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path ...

     

    I don't understand what is ASPNETDB.MDF for (some kind of user tracing DB ??? and why is that file ?), and How can I overcome the above.

     

    One thing, is to create the database file on my machine, and just copy the database file to the hosting machine.

    But for Visual studio 2008, even in my computer, I have got the same error,

    and I didn't see any documentation on VS 2008 to run commandline (I didn't find a command-line in VS 2008,

    and the file aspnet_reqsql neigther).

     

    I think the above suggested solution is right, since user is not full-controling and can write files automatically,

    but how can I do such a file : ASPNETDB.MDF) ?

     

    Any suggestion ?

     

    Thanks :)

     

  • Re: problem on deployment : app_data. - newbie question.

    10-16-2008, 7:52 PM
    • Star
      11,084 point Star
    • Bruce L
    • Member since 02-08-2007, 6:53 PM
    • Posts 1,873

    aspnetdb.mdf is a SQL database file that contains your membership data.  When you run it on your local machine, the database will be attached using SQL Express (installed w/ VS.NET).

    When you upload your application to your hoster which probably doesn't support SQL express, you'll need to attach the database to their SQL server and update the connection string to point to that.

    Bruce
    DiscountASP.NET - ASP.NET Hosting Experts
    Voted 2009 "Best ASP.NET Hosting" by asp.netPRO Magazine
    Win2008/IIS7.0, ASP.NET 2.0/3.5 SP1, MVC, AJAX, Silverlight, SQL 2008/2005
  • Re: problem on deployment : app_data. - newbie question.

    10-17-2008, 6:36 AM
    • Member
      point Member
    • eitanmiz
    • Member since 10-16-2008, 9:57 PM
    • Posts 12

    I didn't succeed creating the database aspnetdb.mdf,

    so I have downloaded it from the site :http://www.4shared.com/file/59591680/a5b7abdf/ASPNETDB_TMP.html, and put it on the hosting machine.

    (It is 10M bytes. too expensive, since I don't much need that file - I just want to do some deployment of CSM : Control System Management)

     I assume that hosting site supports the sql-express, since the sintax I gave at this thread is auto-generated by the site, and I have two databases on the site.

     Two problems :

    1) ) (Minor problem, since I overcome that when downloading another db-file from the site I gave) When trying creating the database on my computer, I got the erro message :

     Setup failed.

    Exception:
    Unable to connect to SQL Server database.

    ----------------------------------------
    Details of failure
    ----------------------------------------

    System.Web.HttpException: Unable to connect to SQL Server database. --->
    System.Data.SqlClient.SqlException: An error has occurred while establishing
    a connection to the server.  When connecting to SQL Server 2005, this
    failure may be caused by the fact that under the default settings SQL Server
    does not allow remote connections. (provider: Named Pipes Provider, error:
    40 - Could not open a connection to SQL Server)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
    exception, Boolean breakConnection)
       at
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
    stateObj)
       at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo,
    SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64
    timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean
    integratedSecurity, SqlConnection owningObject)
       at
    System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
    serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64
    timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
    host, String newPassword, Boolean redirectedUserInstance, SqlConnection
    owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at
    System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
    owningObject, SqlConnectionString connectionOptions, String newPassword,
    Boolean redirectedUserInstance)
       at
    System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
    identity, SqlConnectionString connectionOptions, Object providerInfo, String
    newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at
    System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
    options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection
    owningConnection)
       at
    System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
    owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
    owningObject)
       at
    System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
    owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
    owningObject)
       at
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
    owningConnection)
       at
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
    outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Web.Management.SqlServices.GetSqlConnection(String server,
    String user, String password, Boolean trusted, String connectionString)
       --- End of inner exception stack trace ---
       at System.Web.Management.SqlServices.GetSqlConnection(String server,
    String user, String password, Boolean trusted, String connectionString)
       at System.Web.Management.SqlServices.SetupApplicationServices(String
    server, String user, String password, Boolean trusted, String
    connectionString, String database, String dbFileName, SqlFeatures features,
    Boolean install)
       at System.Web.Management.SqlServices.Install(String database, SqlFeatures
    features, String connectionString)
       at System.Web.Management.ConfirmPanel.Execute()

    2) (Major problem, since I cannot continue) :

    The file is 10M !!!

    Nevertheless, I got the following message,

    and I think there is another file I have to copy.

     

    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

     

     

    Thanks :)

  • First deployment. ASPNETDB problems

    10-19-2008, 5:34 PM
    • Member
      point Member
    • eitanmiz
    • Member since 10-16-2008, 9:57 PM
    • Posts 12

    Hello.

    I have openned this thread, after desperate tries to put on the air the deploymented project.

    See the thread : http://forums.asp.net/p/1335247/2689515.aspx#2689515

     

    Still, I have a problem.

     

    I want to deploy the site, I have written in Visual Studio 2008,

    and want to put it on an hosting machine.

     

    The app_data folder :  the ASPNETDB is created automaticaly.

    I don't know if ASPNETDB is realy necessary, but I still see I cannot access the site.

    For first time - can't I just deploy my project without the ASPNETDB (and project should work, with no exceptions) ?

    Second - If ASPNETDB is necessary, I need step by step, how can I deploy my project,

    and how can I use ASPNETDB ?

     

    Help, please.

     

    Thanks :)

  • Re: First deployment. ASPNETDB problems

    10-20-2008, 2:10 PM
    • All-Star
      75,914 point All-Star
    • jeff@zina.com
    • Member since 09-26-2003, 6:43 AM
    • Naples, FL, USA
    • Posts 10,339
    • Moderator
      TrustedFriends-MVPs

    eitanmiz:
    I have openned this thread,

    I combined them back to one thread.  Please stay in the original thread instead of repeating the questions in new threads.

    As for using the ASPNETDB you must have the correct connection string for it and upload it or transfer it to your host in a manner that your host provides.  The default on is in SQL Server Express, but your host may provide SQL Server.  In that case you may have to attach the file in your App_Data folder to your host's SQL Server.  You need to find out what your host supports before anyone can tell you how to deploy it.

    Also look at:

    http://blah.winsmarts.com/2006/05/19/aspnetdb--production-deployment--practical-tips.aspx
    http://weblogs.asp.net/scottgu/archive/2006/12/22/recipe-deploying-a-sql-database-to-a-remote-hosting-environment-part-1.aspx
    http://www.c-sharpcorner.com/UploadFile/dsdaf/104012006083052AM/1.aspx?ArticleID=e36614ce-c6a5-461b-8e97-a6826f01be4a

    Jeff

    Blatant Self Promotion: ASP.NET 3.5 CMS Development
Page 1 of 1 (5 items)