简体   繁体   中英

How do I set the .application icon for a ClickOnce deployment (online only)

I have a clickonce application that I would like to have the ApplicationName.application file have an icon for the application. Currently the ApplicaitonName.applicaiton file has the default window with blue top and green arrow standard icon.

I have an application icon under the application setup, resources, icon and manifest. That application icon is set to content (i have also tried with it set to embedded resource). That application icon shows up as the window icon and toolbar icon for the application when it is running.

Under publish I publish to a UNC Path and have the "The application is available online only" radio button clicked. Under Application Files the Resources\\ApplicationIcon.ico is Publish Status: Include (Auto), Download Group: (Required), Hash: Include (if the icon is embedded resource it is not in the Application Files).

I generally open the UNC Path and create a shortcut to the .application file to run the application then. I just want that .application file to have the same icon as the windows and toolbar, but not sure what else i need to do to accomplish that. Any help is much appreciated.

The .application file is the deployment manifest. I don't think you can add an icon in that file. Why should it matter to have the default window icon as it is not seen by the client if hosted in IIS.
On the other hand you can definitely add an icon to the appplication manifest (the .manifest file) and this icon is what shown on the start menu and in the application. The .manifest file should look like

<asmv1:assembly .. />
  <description asmv2:iconFile="custom.ico" xmlns="urn:schemas-microsoft-com:asm.v1" />
 ...  

In my msbuild script I use the GenerateApplicationManifest task to set the IconFile

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM