ClickOnce release error: Cannot publish because a project failed to build

Source: Internet
Author: User

After the development and testing of. net programs are completed, there is also an important step-deployment. As a user, it is naturally hoped that the more silly and humanized the better .. Net comes with the following deployment options:

1. Xcopy Utility

2. Copy Web tools

3. Publish a Web site

4. Deploy the project(There are four categories: Create a merging module, create an installer for the customer application, create an installer for the Web application, and create a Compact Framework for the smart device) to create the installer. You can also create a cab file .)

5. ClickOnce

The first four methods are widely used,This document describes how to use ClickOnce.

ClickOnce is a deployment technology that allows applications to be automatically upgraded. Applications are published to media such as file sharing, Web sites, and CD. Then, the ClickOnce application can be automatically upgraded without user interference. ClickOnce also solves the security permission issue. In general, to install an application, you must have the management permission. With ClickOnce, you can install and run the application as long as you have the minimum permissions required to run the application.
First, let's take a look at the differences between ClickOnce and common windows inStaller programs:

  ClickOnce Windows Installer
Application installation location ClickOnce application Cache Program Files Folder
Installation for multiple users No Yes
Install shared files No Yes
Install the driver No Yes
Install it in GAC No Yes
Add an application to the "Start" group No Yes
Add an application to the menu No Yes
Registered file type No Yes
Access the Registry No. You have Full Trust permission to access HKLM. Yes
File binary Patching Yes No
Install the Assembly as needed Yes No

In some cases, it is better to use Windows Installer, but ClickOnce also applies to many applications. ClickOnce applications are displayed on the "Add/delete programs" Control Panel option, which is the same as other installed applications. One major difference is that you can choose to uninstall the application or roll back to the previous version. ClickOnce saves previous versions in the ClickOnce application cache.

This article omitted the use of Winows Installer. The following describes how to deploy a ClickOnce task:

1. The main program is created and tested successfully!

2. Create a web program and publish the main program to the web directory.

Make sure to deploy the web application to IIS.


Main Program release options:

Whether to create a desktop icon:

At this point, the customer can install the program online from this address. The web program directory generates three files:

 

3. Install the program from the specified web path


 


 

 

4. Upgrade and roll back the installer.

First, modify the main program concurrently and the new version, as shown below:

When the user re-runs the main program or publishes publish.htm, the following prompt is displayed:

After the upgrade is successful, the page is displayed:

The control panel is as follows:

In this case, select change/Delete to select the previous version or delete it permanently. If you select the previous version, see the following:

 

5. Problems:

When the project-right-click-properties-publish wizard is displayed, the following error occurs: Cannot publish because a project failed to build.

Strange! The solution is as follows:

1. Independently generate a project, regenerate a project, clear the project, and delete all obj and bin directories. You have tried to generate a project, but an error occurred while releasing the project. The above prompt is displayed.

2. If the IIS permission is suspected, grant all permissions to the network service account of the web project folder.

3. Clear the Certificate in IE-Option-content.

4. An error still occurred while proactively modifying a new version.

Google became my treasure-saving, and finally found a similar message, saying that it was just right-click to publish it. Finally succeeded! For example:

Incorrect method:

The correct method:

Vi. Problem Analysis:

Actually, the fuse command mage.exe or its UI program mageUI.exe is used to modify the corresponding application options.

For instructions on MageUI, see MSDN: http://msdn.microsoft.com/zh-cn/library/xhctdw55%28VS.80%29.aspx

You can enter mageui.exe in the Command Prompt (2010.pdf of the program-Microsoft Visual Studio 2010-Visual Studio Tools-Visual Studio Command. The following page is displayed:

In practice, mage.exeor mageui.exe should be used to create the wrong interface and the two sides of success,The error may be caused by inconsistent parameters during the call.This should be a bug in Vs2010 RTM. (Appendix: The ClickOnce application has two XML-based configuration files, one of which is the Application List and the other is the deployment list. These two files describe all the information required to deploy the application. The application information contained in the Application List has the required permissions, programs to be included, and other dependent files. The deployment list contains the deployment information of the application. The location information of the Application List is included in the deployment list .)

Note:

1. Application cache: Applications published with ClickOnce cannot be installed in the Program Files folder and they will be placed in the application cache, the application cache is located in the Local Settings sub-folder of the current user's Document's and Settings folder. This function allows you to control the deployment of multiple application versions on the client at the same time. If the application is set to run online, each version accessed by the user is retained. For applications that are set to run locally, the current and previous versions are retained. Therefore, it is a very simple process to roll back a ClickOnce application to a previous version. If you enter the "Add/delete programs" Control Panel option, the displayed dialog box allows you to delete a ClickOnce application or roll back to a previous version. The administrator can modify the configuration file to point to the previous version. The next time you start the application, the system checks whether the version is updated. The application does not search for the new assembly to be deployed, but restores the previous version without user interference. This is also an advantage of ClickOnce deployment.

2. the customized content of ClickOnce is simple. If you need a more refined user dialog interface, you still need to customize Windows Installer or use third-party professional tools such as InstallShield. However, it provides a user-friendly self-management mechanism that almost achieves real No Touch Deployment ).

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.