C #. Net clickonce

Source: Internet
Author: User
Document directory
  • Notes
Release versions using clickonce segments

Clickonce is a technology released by Microsoft in the. NET 2.0 Framework. It allows you to conveniently deploy and update. Net Windows applications in Visual Studio. The deployment function is implemented by copying an application file to a folder, an FTP directory, or a web location, and attaching a configuration file. A configuration file is an XML file with the. application extension. It contains a list of all program files and security-related information such as the publisher identity. Each time a new version is released for a clickonce application, a new sub-directory is created and the updated files are stored in this directory. All deployment versions of the program are independent of each other, which means that we only need to identify the users and direct the users to the appropriate versions of the application to control the programs whose versions need to be accepted.

Focus on. NET and other Microsoft enterprise development solutions, and provide first-class information for the Chinese. Net community through news, articles, video interviews, presentations, and mini books.

First, let's create a simple windows application and deploy it through clickonce. Create a new windows application project, place a tag control on the form, and write some code in the new () process so that we can see which version we have.

    label1.Text = "Version: " & _ 
System.Reflection.Assembly.GetExecutingAssembly.GetName.Version.ToString

Now, open the project properties page and browse the signing tab. Select the "sign the clickonce manifest" check box, click "create test certificate" and enter the password to create a test certificate.

Now that we have a certificate, you can set clickonce deployment. Select the publish tab, and enter the publishing location, that is, the installation URL (you can also use the publish wizard (publish wizard) at the bottom to directly enter these ). The release location is the physical location where the deployment files will be stored. The installation URL is the URL used by the user to download and install the application. We plan to enable this application to run offline, so select the second single release under "Install mode and settings. To implement the version control function, we need to deploy the program file to the folder tree of a Web application. Pay attention to this when selecting the deployment location.

Note: you can click "updates..." to display the update options.

So far, we have a clickonce application that can be deployed. Once deployed and installed, the application will check for updates each time it starts.

If a new version exists, you will be prompted to update it.

Now we have deployed a clickonce application, and we can implement version control. The principle of version refinement control is to set a Web-based redirection function for the main file. application. First, we need to add the. application extension to the list of allowed files of ISS. This can be achieved through the Web site attribute in IIS and the application configuration section on the Home Directory tab in the interface.

Once this step is completed, you can create a new webapplication and add a handler class to it.

Then, register the handler in the web. config file of the application. The format of the handler type is [namespace]. [classname], [Assembly]

<Httphandlers>
<Add verb = "get" Path = "*. Application" type = "webapplication1.myhandler, webapplication1"/>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.