I made a simple WPF application in Visual Studio.
It accesses its database file in your own directory using this connection string:
System.Environment.CurrentDirectory + @"\Data\" + databaseFileName;
I clicked Publish and basically accepted all the default settings (publishing to CD / DVD, without online updates).
I copied the installation folder to another computer.
On the new computer, I double-click setup.exe .
It installs fine, is in the start menu, but when it starts, it gets this error :
alt text http://www.deviantsart.com/upload/11jfc2c.png
I gave the application all the permissions that I can in the project / properties / security:
alt text http://www.deviantsart.com/upload/si6urj.png
What I need to change so that this application deployed with ClickOnce can find its database in the relative directory under the .exe file, i.e. "Data / MainData.mdf"?
ADDITION The fix in the answer below works for Windows 7, but in Windows XP I get the following:
alt text http://www.deviantsart.com/upload/1pds19l.png
source
share