Page view counter

Can't copy .mdf and .ldf onto server.

Last post 08-07-2007 8:03 AM by XiaoYong Dai – MSFT. 10 replies.

Sort Posts:

  • Can't copy .mdf and .ldf onto server.

    08-02-2007, 1:50 PM
    • Loading...
    • fastfust
    • Joined on 08-02-2007, 5:37 PM
    • Posts 21
    • Points 2

    Hi all,

     would very much appreciate your advice. I'm a new starter to ASP.NET2.0 etc, however have wriiten my first website - which within Microsoft Visual Web Developer 2005 Express compiles and runs fine. The website is very bare bones at the moment - a number of secure pages behind a login page.

     When I use the "copy Web Site" utility, to returns an error (log view - error as below). My server is running all the relevant software including .NET Framework2.0 and SQL Server 2005. I have tried copying using a different FTP utility which returns the same result.

     Can anyone provide any advice to what i need to do to copy all files and run my site on my server.

     Copy file ASPNETDB.MDF from source to remote Web site.
                Has error -- Unable to add 'httpdocs/App_Data/ASPNETDB.MDF' to the Web.  550 httpdocs/App_Data/ASPNETDB.MDF: Access is denied.
                Copy file aspnetdb_log.LDF from source to remote Web site.
                Has error -- Unable to add 'httpdocs/App_Data/aspnetdb_log.LDF' to the Web.  550 httpdocs/App_Data/aspnetdb_log.LDF: Access is denied

     Thanks and best regards,

    FastFust

  • Re: Can't copy .mdf and .ldf onto server.

    08-02-2007, 2:06 PM
    Answer
    • Loading...
    • Freakyuno
    • Joined on 01-20-2005, 4:57 PM
    • Midwest - United States
    • Posts 1,952
    • Points 12,508
    • TrustedFriends-MVPs

    Is there already a copy of that database and log file on the website your trying to copy to?

    IIS and the SQL engine will grab ahold of thoes, and not let you delete them, or copy over them while there's an open session.  You're going to have to stop the application pool they are in to be able to delete them and put new versions up, if thats the case.

    You're other option, is to Generate change scripts in your application, to update the database thats there, and call an admin page of some sort that modifies the running database, so you dont have to take your application offline to update the DB schema.

  • Re: Can't copy .mdf and .ldf onto server.

    08-02-2007, 2:31 PM
    • Loading...
    • fastfust
    • Joined on 08-02-2007, 5:37 PM
    • Posts 21
    • Points 2

    Thanks for the feedback - the server that i'm coping to does not currently have an mdf or ldf file. Does this make a difference to your advice?

  • Re: Can't copy .mdf and .ldf onto server.

    08-02-2007, 3:52 PM
    • Loading...
    • Freakyuno
    • Joined on 01-20-2005, 4:57 PM
    • Midwest - United States
    • Posts 1,952
    • Points 12,508
    • TrustedFriends-MVPs

    Yep, at that point it could be about anything.  What method are you using to copy to the server via the copy website?  Is it an FTP access, shared drive, FrontPage extensions?

  • Re: Can't copy .mdf and .ldf onto server.

    08-02-2007, 4:20 PM
    • Loading...
    • fastfust
    • Joined on 08-02-2007, 5:37 PM
    • Posts 21
    • Points 2
    have tried both FTP from Visual Web Development 2005 express and another FTP utility
  • Re: Can't copy .mdf and .ldf onto server.

    08-06-2007, 4:07 AM

    Hi

    Sorry for interruption. Can it be some external problems?

    1, Try to rename the file ASPNETDB.MDF and upload it again (sometimes the FTP server caches the file)

    2, You may contact your web administrator and check if your account has granted the "write" permission.

     

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Can't copy .mdf and .ldf onto server.

    08-06-2007, 5:23 AM
    • Loading...
    • fastfust
    • Joined on 08-02-2007, 5:37 PM
    • Posts 21
    • Points 2

    Thanks all for your help, I have now been able to upload this file. Unfortunately i am still having problems with the deployment - any advice would be appreciated.

     

    firstly - when i compile and run my website locally in Visual Web developer 2005 everythink works fine with out error - I have a very simple website which includes a login application which utilises a mdf file. I have uploaded the site onto my server, and again everythink is OK until it comes to login. At login entering the correct username and password returns a incorrect details message! The same thing happens if i remove the database mdf file from my locally run website (same result). I'm therefore assuming that the server version isn't accessing the mdf file to read the credentials and verify.

     

    Can anyone offer any advice to how i should be mapping my .mdf and .ldf file onto my server so that it works.

     

    I have .Net Frameworks 2.0 and SQL Server 2005 Express installed on my server.

     

    Thanks and best regards,

     

    Fastfust  

  • Re: Can't copy .mdf and .ldf onto server.

    08-06-2007, 6:49 AM

    Hi

    Could you please paste your web.config file?

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Can't copy .mdf and .ldf onto server.

    08-06-2007, 7:52 AM
    Answer
    • Loading...
    • mubashirjavaid
    • Joined on 12-05-2006, 7:08 AM
    • Pakistan
    • Posts 25
    • Points 108

    I think behind the seen the Sql server is using your mdf and ldf files. Try to disable the server and then copy files. When server is accessing these file then it does not allow copying.

    If sql server icon is shown on the system tray then by using this link disable the server else user service explorer to stop SqlServer Service  

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved.
  • Re: Can't copy .mdf and .ldf onto server.

    08-06-2007, 8:18 AM
    • Loading...
    • fastfust
    • Joined on 08-02-2007, 5:37 PM
    • Posts 21
    • Points 2

    Thanks for the reply - Web.config file below: 

     

    <?
    xml version="1.0"?><!--

    Note: As an alternative to hand editing this file you can use the

    web admin tool to configure settings for your application. Use

    the Website->Asp.Net Configuration option in Visual Studio.

    A full list of settings and comments can be found in

    machine.config.comments usually located in

    \Windows\Microsoft.Net\Framework\v2.x\Config

     

    -->

    <
    configuration><appSettings/>

     

    <system.web>

    <customErrors mode="Off"/>

     

     

    <
    siteMap defaultProvider="default">

    <providers>

    <clear />

    <add name="default" type="System.Web.XmlSiteMapProvider" siteMapFile="web.sitemap"

     

    securityTrimmingEnabled="true" />

    </providers>

    </siteMap>

     

     

    <!--

    Set compilation debug="true" to insert debugging

    symbols into the compiled page. Because this

    affects performance, set this value to true only

    during development.

    Visual Basic options:

    Set strict="true" to disallow all data type conversions

    where data loss can occur.

    Set explicit="true" to force declaration of all variables.

    -->

    <roleManager enabled="true" />

    <compilation debug="true" strict="false" explicit="true"/>

    <pages>

    <namespaces>

    <clear/>

    <add namespace="System"/>

    <add namespace="System.Collections"/>

    <add namespace="System.Collections.Specialized"/>

    <add namespace="System.Configuration"/>

    <add namespace="System.Text"/>

    <add namespace="System.Text.RegularExpressions"/>

    <add namespace="System.Web"/>

    <add namespace="System.Web.Caching"/>

    <add namespace="System.Web.SessionState"/>

    <add namespace="System.Web.Security"/>

    <add namespace="System.Web.Profile"/>

    <add namespace="System.Web.UI"/>

    <add namespace="System.Web.UI.WebControls"/>

    <add namespace="System.Web.UI.WebControls.WebParts"/>

    <add namespace="System.Web.UI.HtmlControls"/>

    </namespaces>

    </pages>

    <!--

    The <authentication> section enables configuration

    of the security authentication mode used by

    ASP.NET to identify an incoming user.

    -->

    <authentication mode="Forms" />

    <!--

    The <customErrors> section enables configuration

    of what to do if/when an unhandled error occurs

    during the execution of a request. Specifically,

    it enables developers to configure html error pages

    to be displayed in place of a error stack trace.

    <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

    <error statusCode="403" redirect="NoAccess.htm" />

    <error statusCode="404" redirect="FileNotFound.htm" />

    </customErrors>

    -->

    </system.web>

    </configuration>

    Asp.Net Configuration option in Visual Studio. A full list of settings and comments can be found in machine.config.comments usually located in \Windows\Microsoft.Net\Framework\v2.x\Config --> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. -->
  • Re: Can't copy .mdf and .ldf onto server.

    08-07-2007, 8:03 AM
    Answer

    Hi

    I think your application won't work well with Login Control since you haven't specified the Membership & connectionString in your web.config.

    Here you can get more information about this issue.

    http://msdn2.microsoft.com/en-us/library/1b9hw62f.aspx

    http://weblogs.asp.net/scottgu/archive/2006/04/22/443634.aspx

     

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (11 items)