I am making a desktop application in C#, VS 2010 on Windows XP SP2 Pro.
If i run that application directly from published folder without running setup OR run it from debug folder OR simply debug the application, it does not give this error.
But if i run setup from published folder and then run it from start menu, it gives this error.
(edited)An attempt to attach an auto-named database for file C:\Documents and Settings\Desi\Local Settings\Apps\2.0\Data\K9KMBYK5.881\EKOOHKP2.0Y1\smas..tion_ddac366ea7cca062_0001.0000_c8a0800c5798ef15\Data\SmasDb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
I am publishing application to a folder in 'my documents'.
Update:
C:\Documents and Settings\Desi\Local Settings\Apps\2.0\Data\K9KMBYK5.881\EKOOHKP2.0Y1\smas..tion_ddac366ea7cca062_0001.0000_c8a0800c5798ef15\Data\1.0.0.0
(this Data directory has only user.config file)
C:\Documents and Settings\Desi\Local Settings\Apps\2.0\LWGCKB30.QZJ\E81QYJON.ZX9\manifests
(contains
smas..tion_ddac366ea7cca062_0001.0000_none_a42d8ca7a940cae4.cdf-ms
smas..tion_ddac366ea7cca062_0001.0000_none_a42d8ca7a940cae4.manifest
smas.exe_ddac366ea7cca062_0001.0000_none_3d144d2ce016963b.cdf-ms
smas.exe_ddac366ea7cca062_0001.0000_none_3d144d2ce016963b.manifest)
C:\Documents and Settings\Desi\Local Settings\Apps\2.0\LWGCKB30.QZJ\E81QYJON.ZX9\smas.exe_ddac366ea7cca062_0001.0000_none_3d144d2ce016963b
(contains
SMAS.exe.config, SmasDb.mdf, SmasDb_log.ldf)
C:\Documents and Settings\Desi\Local Settings\Apps\2.0\LWGCKB30.QZJ\E81QYJON.ZX9\smas..tion_ddac366ea7cca062_0001.0000_c8a0800c5798ef15
(this directory has all files including all dlls, SmasDb.mdf and SmasDb_log.ldf, SMAS.exe.config, some .cdf-ms and .manifest files NOT same as above .cdf-ms and .manifest)