question

DavidLittle-1169 avatar image
0 Votes"
DavidLittle-1169 asked DavidLittle-1169 answered

ClickOnce app doesn't update on startup.

I have a ClickOnce app that will not update itself when it's starting, although I can force it to update itself by removing the cache folder at %userprofile%\Local\Apps\2.0, but that's really a reinstall. My users can install from an external website - since this app is pre-release, there are several versions a day, and Jenkins is publishing it. I included the relevant part of the .csproj below - i masked out some of the identifying stuff.

Any ideas from anyone?

thank you!

  • David



    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <Deterministic>false</Deterministic>
    <NuGetPackageImportStamp>
    </NuGetPackageImportStamp>
    <IsWebBootstrapper>true</IsWebBootstrapper>
    <PublishUrl>publish\</PublishUrl>
    <Install>true</Install>
    <InstallFrom>Web</InstallFrom>
    <UpdateEnabled>true</UpdateEnabled>
    <UpdateMode>Foreground</UpdateMode>
    <UpdateInterval>7</UpdateInterval>
    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
    <UpdatePeriodically>false</UpdatePeriodically>
    <UpdateRequired>true</UpdateRequired>
    <MapFileExtensions>true</MapFileExtensions>
    <ProductName>{appname goes here}</ProductName>
    <PublisherName>{companyname goes here}</PublisherName>
    <MinimumRequiredVersion>0.6.0.10</MinimumRequiredVersion>
    <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
    <WebPage>index.html</WebPage>
    <AutorunEnabled>true</AutorunEnabled>
    <ApplicationRevision>119</ApplicationRevision>
    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
    <UseApplicationTrust>true</UseApplicationTrust>
    <CreateDesktopShortcut>true</CreateDesktopShortcut>
    <PublishWizardCompleted>true</PublishWizardCompleted>
    <BootstrapperEnabled>true</BootstrapperEnabled>


dotnet-csharp
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DavidLittle-1169, I want to confirm if you set the Options The application should check for updates in your app.

Like the following :

135455-image.png

If so, please make sure that your computer is networked.



0 Votes 0 ·
image.png (28.9 KiB)

Yes, it is checked. In the .csproj file, the two relevant tags are:

<UpdateEnabled>true</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>

The problem is that it doesn't update when the user starts the app. i stopped working around the same time i started deploying a signed app, but that may be more of a coincidence than a cause.

0 Votes 0 ·

@DavidLittle-1169, based on my test, I could not reproduce your problem. I recommend that you could report a problem about .NET in Developer Community


0 Votes 0 ·

1 Answer

DavidLittle-1169 avatar image
0 Votes"
DavidLittle-1169 answered

I found the problem, but not the solution. in the .application file generated from MSBuild and .csproj, the XML is:

   <deployment install="true" mapFileExtensions="true" minimumRequiredVersion="0.6.0.10" co.v1:createDesktopShortcut="true">
     <subscription>
       <update>
         <beforeApplicationStartup />
       </update>
     </subscription>
     <deploymentProvider codebase="https://{somepathtomy}.application" />
   </deployment>

After signing with mage, that code is changed to:

   <deployment install="true" mapFileExtensions="true" minimumRequiredVersion="0.6.0.10" co.v1:createDesktopShortcut="true">
     <subscription>
       <update>
         <expiration maximumAge="1" unit="days" />
       </update>
     </subscription>
     <deploymentProvider codebase="https://static-dev.construxiv.app/CXvDesktop.application" />
   </deployment>

there doesn't seem to be a mage.exe flag to control <update>, at least that I can find. I found some comments from 2006 (https://social.msdn.microsoft.com/Forums/windows/en-us/2d32037b-e43a-4c4f-b55d-27eab1b7bd58/urgent-mageexe-issue-with-requiredupdate) with the same issue and am hoping that the issue has a proper resolution in the intervening 15 years. Any ideas?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.