Application Patterns and Tips : Deploy Applications Using ClickOnce
| Scenario/Problem: | You want to deploy your application via the Web, with a very simple process. | ||||||||||||||||||||||
| Solution: | Use OneClick deployment. Here are the steps to follow:
|
Figure 1 shows the Publish settings in Visual Studio.
Figure 1. The Publish options allow you to specify where to put the setup files.
Once all of the options are set, you can right-click the project and select Publish.
To run the application, navigate to the generated HTML file and click Run. The .NET runtime will run your application under the restrictions you placed on it. To see the effect, the sample application lets you try to write a file both to the file system and to isolated storage. Only isolated storage is accessible.
Figure 2 shows what happens when a locally-installed ClickOnce application with limited permissions tries to touch the file system.
Figure 2. In a partial-trust application, trying to access local resources such as the file system will result in an exception.
Note
You cannot create WPF windows in a partial-trust environment: You’re limited to the browser window.