Those options are only available with .NET 3.5. If you change the target framework to 3.5 they'll be available.
Deploying data files can be tricky with ClickOnce. There is an option in the publish area, Application Files, to define which files are Data Files. The file must be included in the VS project and marked as Content and set to either
Copy Always or
Copy when newer. You can then set the file as a data file. When you do this ClickOnce will copy the file to a special DataDirectory related to the application. It will also handle updates differently. Some things you will need to consider:
- The location of the data file will be different depending on if the application is run via ClickOnce. I.e. the data directory is in a different location when run under ClickOnce vs when you run it standalone (like when debugging). This means you have to have code to detect this state. You use the ApplicationDeployment.IsNetworkDeployed property to determine this.
- You will need to dynamically configure connection strings based on how it is opened. Also, the data file moves every time there is an update, so you
always have to dynamically set the connection strings for normal ClickOnce deployments.
- Updates are handled differently. There are two scenarios to consider:
1. You do an update, the data file doesn't change (the schema).
2. You do an update and the data file does change (the schema).
In case 1, ClickOnce will figure this out and copy the data file the user has been using the new data directory (every update of an application gets installed in its own folder, with an associated data folder). This is the easy case and you have to do nothing.
In case 2, ClickOnce will determine there is a new data file and it will download the new data file. It will also copy the one the users have changed for the old version to a /.pre folder under the data directory. In this case
you must include some migration code to handle moving the existing data into the new file.
- The trust level that ClickOnce runs under can affect this as well.
- You need to figure out how to deploy the underlying database software. You can use the Bootstrapper or in some cases you can embedd the engine in you app.
ClickOnce can get pretty complex in this situation. I highly recommend the book by Brian Noyes (included link in a previous post). Here are some more links that might help.
Here's link talking about where data files can be put:
http://msdn.microsoft.com/en-us/library/d8saf4wy.aspxLink talking about how to add data files:
http://www.codeproject.com/KB/install/ClickOnce-Configuration.aspx