Application Patterns and Tips : Deploy Applications Using ClickOnce

8/21/2012 4:13:14 PM
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:
Right-click the project in the Solution Explorer and select Properties.

Click the Security tab.

Check the Enable ClickOnce Security Settings box.

Select the appropriate trust level. Partial trust will cut off your application from most of the computer’s resources, such as the file system.

Select the zone the application will be installed from.

Click the Publish tab

Select the folder to which you wish to publish the setup files.

Select whether the application should also be installed locally and available in the Start menu.

Click Options.

Select Deployment.

Enter a deployment web page, such as publish.htm.

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.


You cannot create WPF windows in a partial-trust environment: You’re limited to the browser window.

  •  Application Patterns and Tips : Localize a WPF Application
  •  20 Top Tips Sunrise & Sunset (Part 2)
  •  20 Top Tips Sunrise & Sunset (Part 1)
  •  70 Ways To Take Better Photos (Part 7) - Process your shots
  •  70 Ways To Take Better Photos (Part 6) - Wildlife, How to achieve excellent wildlife images
  •  70 Ways To Take Better Photos (Part 5) - Check you’re covered
  •  70 Ways To Take Better Photos (Part 4) - Monochrome, Adjust colour channels
  •  70 Ways To Take Better Photos (Part 3) - Portraits, Adjust light intensity
  •  70 Ways To Take Better Photos (Part 2) - Improve your vista shots
  •  70 Ways To Take Better Photos (Part 1)
  •  Go Outside And Play
  •  MEElectronics Air-Fi AF32
  •  Lenco iPT-223
  •  Adobe Photoshop CS5 : Working with Automate Commands - Creating a PDF Document
  •  Adobe Photoshop CS5 : Working with Automate Commands - Converting a Multi-Page PDF to PSD
  •  Corel Painter X : Working with Layers - More Furniture
  •  Corel Painter X : Working with Layers - The Chair
  •  Aperture 3.3 : Nipping at Lightroom’s heels
  •  Orbitsound T9 : Music of the spheres
  •  Jawbone Big Jambox
    Top 10
    Nikon 1 J2 With Stylish Design And Dependable Image And Video Quality
    Canon Powershot D20 - Super-Durable Waterproof Camera
    Fujifilm Finepix F800EXR – Another Excellent EXR
    Sony NEX-6 – The Best Compact Camera
    Teufel Cubycon 2 – An Excellent All-In-One For Films
    Dell S2740L - A Beautifully Crafted 27-inch IPS Monitor
    Philips 55PFL6007T With Fantastic Picture Quality
    Philips Gioco 278G4 – An Excellent 27-inch Screen
    Sony VPL-HW50ES – Sony’s Best Home Cinema Projector
    Windows Vista : Installing and Running Applications - Launching Applications
    Most View
    Bamboo Splash - Powerful Specs And Friendly Interface
    Powered By Windows (Part 2) - Toshiba Satellite U840 Series, Philips E248C3 MODA Lightframe Monitor & HP Envy Spectre 14
    MSI X79A-GD65 8D - Power without the Cost
    Canon EOS M With Wonderful Touchscreen Interface (Part 1)
    Windows Server 2003 : Building an Active Directory Structure (part 1) - The First Domain
    Personalize Your iPhone Case
    Speed ​​up browsing with a faster DNS
    Using and Configuring Public Folder Sharing
    Extending the Real-Time Communications Functionality of Exchange Server 2007 : Installing OCS 2007 (part 1)
    Google, privacy & you (Part 1)
    iPhone Application Development : Making Multivalue Choices with Pickers - Understanding Pickers
    Microsoft Surface With Windows RT - Truly A Unique Tablet
    Network Configuration & Troubleshooting (Part 1)
    Panasonic Lumix GH3 – The Fastest Touchscreen-Camera (Part 2)
    Programming Microsoft SQL Server 2005 : FOR XML Commands (part 3) - OPENXML Enhancements in SQL Server 2005
    Exchange Server 2010 : Track Exchange Performance (part 2) - Test the Performance Limitations in a Lab
    Extra Network Hardware Round-Up (Part 2) - NAS Drives, Media Center Extenders & Games Consoles
    Windows Server 2003 : Planning a Host Name Resolution Strategy - Understanding Name Resolution Requirements
    Google’s Data Liberation Front (Part 2)
    Datacolor SpyderLensCal (Part 1)