attempt to attach an auto-named database?

demandzm

New member
Joined
Oct 4, 2015
Messages
2
Programming Experience
1-3
I have been trying to figure this out for over a week now. When I install the program I just published I get an error:
An attempt to attach an auto-named database for file
C:\Users\user\AppData\Local\Apps\2.0\Data\ZBK53C1H.Y5Z\12Q4M493.ZYH\gcfv..tion_70cd99a42d746826_0001.0000_f274e5d4f945010a\Data\Database.mdf failed.
A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.


I checked that directory and found it was empty.
but I did find the database file installed with the rest of the program under appdata\local\apps\2.0.....etc.

If I manually copy the database to the right directory the program runs great.

Why is my database being installed in the wrong directory?

I'm using Visual Studio 2015, sql server 2014 local db, and .net 4.5.2.

Thanks for any help you can offer
 

demandzm

New member
Joined
Oct 4, 2015
Messages
2
Programming Experience
1-3
The build action for the database is set to content.

Edit: I just checked under solution properties \ publish \ application files. and my database.mdf publish status was set to content as well. changed it to "data file' and it works just fine. Thanks for pushing me in the right direction.
Btw I thought I recognized your user name, you helped me out over at vbforums. Had to post here as vbforums wont allow me to log in anymore.
 
Last edited:

Latest posts

Top Bottom