Visual Studios locks .MDF file when using Web Deployment Project

Last post 10-02-2009 10:06 AM by Rajneesh Verma. 3 replies.

Sort Posts:

  • Visual Studios locks .MDF file when using Web Deployment Project

    10-02-2009, 9:35 AM
    • Member
      6 point Member
    • kshill
    • Member since 01-27-2006, 6:38 PM
    • Posts 3

    Hello,

    I'm using Visual Studio 2008 and Web Deployment Projects to develop an ASP.NET web site.
    The site uses a LinqDataSource to connect to a database within a database file (.mdf) on my local machine (a different source will be used in the release)
    When I run my website for testing the link works correctly and everything appears kosher but when I stop the debugger and attempt to rebuild the project in VS2008 I get this error from the compiler:

    The process cannot access the file '<filepath>.mdf' because it is being used by another process.

    To build my project again I'm forced to exit VS2008 and re-start it.  Obviously, this is very inconvenient.  What could I be doing wrong?

    Thank you.

  • Re: Visual Studios locks .MDF file when using Web Deployment Project

    10-02-2009, 9:50 AM
    Answer
    • Contributor
      3,278 point Contributor
    • Rajneesh Verma
    • Member since 07-15-2008, 6:22 AM
    • Lucknow, U.P. INDIA
    • Posts 745

    Hi,

    For this you should check your system tray where ASP.NET Development Server - Port ---- is running double click on it then stop it and Then Try to Rebuild Website  .. Try it

    Hope helps you..........


    Thanks..

    RajneesH Verma
    Sr. Software Developer
    09839040266
    Technology Specialist at www.innovateonindia.com

    Please remember to click "Mark as Answer" on the post that helps you and close that thread which fulfill your requirement.
  • Re: Visual Studios locks .MDF file when using Web Deployment Project

    10-02-2009, 9:56 AM
    • Member
      6 point Member
    • kshill
    • Member since 01-27-2006, 6:38 PM
    • Posts 3

    Thanks Rajneesh!

    That works.  But lazy person that am, I still don't like having to do this Smile.  is there a way to make this automatic or to otherwise avoid it?

    Kerry

  • Re: Visual Studios locks .MDF file when using Web Deployment Project

    10-02-2009, 10:06 AM
    • Contributor
      3,278 point Contributor
    • Rajneesh Verma
    • Member since 07-15-2008, 6:22 AM
    • Lucknow, U.P. INDIA
    • Posts 745

    Hi,

    Check this link. Hope helps you..........

    http://forums.asp.net/p/1439543/3270408.aspx#3270408


    Thanks..

    RajneesH Verma
    Sr. Software Developer
    09839040266
    Technology Specialist at www.innovateonindia.com

    Please remember to click "Mark as Answer" on the post that helps you and close that thread which fulfill your requirement.
Page 1 of 1 (4 items)