locked
Lightswitch move Project: The underlying provider failed on Open. Inner exception message: Could not open new database *\APPLICATIONDATABASE.MDF RRS feed

  • Question

  • Hello,

    I create a Lightswitch Project on "Computer 1" and check in to TFS. Now I got new Computer 2. On this i check out my project.

    The first error I got was: An error occurred while establishing a connection to SQL Server instance '(LocalDB)\v11.0'

    I fix this by following a post in  an-error-occurred-while-establishing-a-connection-to-sql-server-instance-localdbv110

    But now I got this error if i Run my project into the Browser.

    The underlying provider failed on Open. Inner exception message: Could not open new database '*APPLICATIONDATABASE.MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database for file *ApplicationDatabase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. File activation failure. The physical file name "*ApplicationDatabase_log.ldf" may be incorrect. The log cannot be rebuilt when the primary file is read-only.

    Whats wrong

    thank for help

    Monday, September 30, 2013 11:49 AM

Answers

  • Hi,

    few things you can try them out:

    1- first thing, Please make sure that the current user has access to the folder where the DB is located (usually under bin/data)

    2- Rebuild your solution. (also try to run , clean then rebuild.)

    3- if non of the above worked and you don't have test data in the database, you could delete the mdf file and rebuild the project to regenerate the data.

    • Proposed as answer by Qwertz77 Tuesday, October 1, 2013 7:09 AM
    • Marked as answer by Angie Xu Monday, October 7, 2013 1:57 AM
    Monday, September 30, 2013 2:15 PM

All replies

  • Hi,

    few things you can try them out:

    1- first thing, Please make sure that the current user has access to the folder where the DB is located (usually under bin/data)

    2- Rebuild your solution. (also try to run , clean then rebuild.)

    3- if non of the above worked and you don't have test data in the database, you could delete the mdf file and rebuild the project to regenerate the data.

    • Proposed as answer by Qwertz77 Tuesday, October 1, 2013 7:09 AM
    • Marked as answer by Angie Xu Monday, October 7, 2013 1:57 AM
    Monday, September 30, 2013 2:15 PM
  • ... thanks. Work fine.

    Tuesday, October 1, 2013 7:10 AM