As a learning experience I am attempting to deploy a project, “BookKeeper” to a CD/DVD (actually I’d like to see if I can deploy it to a thumb drive). It is not a commercial application but one developed for my own use and as a learning experience. It is a C#/WPF project developed on Visual Studio 2013 Express. My computer is running Windows 7. The project uses a SQL Server Express database and also contains one image. The connection string for the database is:
con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=" + "|DataDirectory|\\MyDataBase.mdf;" + "Integrated Security=True;User Instance=True";
The image is opened in XAML with the following code:
<Image Canvas.Left="102" Canvas.Top="122" Width="400" OpacityMask="#FFC2E5DB"
Source="pack://siteoforigin:,,,/Images/MyImage.png"/>
To me, it appears that the only option I have for deploying this project is “One Click” Deployment. Upon attempting the “One Click “ deployment I have run into difficulties. receiving following error messages:
Could not find file ‘MyDataBase.mdf’
Could not find file ‘MyDataBase_log.ldf’
Could not find file ‘Images\MyImage.png’
The database is located in the root project directory, BookKeeper, and the image in a subdirectory \Images prior to initiating the “One Click” deployment but disappear from those directories after the attempted deployment. I have been able to locate the database file in a generated directory:
BookKeeper\bin\Release\app.publish\Application Files\BookKeeper_2_0_0_1 with a further extension added: MyDataBase.mdf.deploy and MyDataBase_log.ldf.deploy (I do not find the image there).
In addition, when I attempt “Rebuild Solution”, I get the same error messages:
Could not find file ‘MyDataBase.mdf’
Could not find file ‘MyDataBase_log.ldf’
Could not find file ‘Images\MyImage.png’
But I cannot find the database or the image anywhere in the project files, they simply disappear into oblivion.
I’ve spent two weeks searching the net for help and found a large number of posts addressing similar but not quite the same problem. Most were directed toward deployment to Web sites, using Visual Studio 2012, using Windows XP. I’ve tried a number of the suggested solutions; they were either not particularly pertinent and did not resolve my problem. Any help would be greatly appreciated.