Hello,
Thanks for you feedback.
I've check this with Reflect and I found that ApplicationDeployment actually call ProcessUpdateCheckResult(), which is a private method, to persist check result in the registry without installing the update. It only checks the Error and the Canceled properties of the CheckForUpdateCompletedEventArgs, it seems there is no way to work around this issue.
private void CheckForUpdateBindCompletedEventHandler(object sender, BindCompletedEventArgs e)
{
Exception error = null;
DeploymentManager manager = null;
bool updateAvailable = false;
Version availableVersion = null;
bool isUpdateRequired = false;
Version minimumRequiredVersion = null;
long updateSize = 0L;
new NamedPermissionSet("FullTrust").Assert();
try
{
manager = (DeploymentManager) sender;
if ((e.Error == null) && !e.Cancelled)
{
TrustParams trustParams = new TrustParams();
trustParams.NoPrompt = true;
manager.DetermineTrust(trustParams);
manager.DeterminePlatformRequirements();
UpdateCheckInfo info = this.DetermineUpdateCheckResult(manager.ActivationDescription);
this.ProcessUpdateCheckResult(info, manager.ActivationDescription); if (info.UpdateAvailable)
{
updateAvailable = true;
availableVersion = info.AvailableVersion;
isUpdateRequired = info.IsUpdateRequired;
minimumRequiredVersion = info.MinimumRequiredVersion;
updateSize = info.UpdateSizeBytes;
}
}
else
{
error = e.Error;
}
}
catch (Exception exception2)
{
error = exception2;
}
finally
{
CodeAccessPermission.RevertAssert();
Interlocked.Exchange(ref this._guard, 0);
CheckForUpdateCompletedEventArgs args = new CheckForUpdateCompletedEventArgs(error, e.Cancelled, null, updateAvailable, availableVersion, isUpdateRequired, minimumRequiredVersion, updateSize);
CheckForUpdateCompletedEventHandler handler = (CheckForUpdateCompletedEventHandler) this.Events[checkForUpdateCompletedKey];
if (handler != null)
{
handler(this, args);
}
if (manager != null)
{
manager.ProgressChanged -= new DeploymentProgressChangedEventHandler(this.CheckForUpdateProgressChangedEventHandler);
manager.BindCompleted -= new BindCompletedEventHandler(this.CheckForUpdateBindCompletedEventHandler);
new NamedPermissionSet("FullTrust").Assert();
try
{
manager.Dispose();
}
finally
{
CodeAccessPermission.RevertAssert();
}
}
}
}
I've log this feature into our product database, product team will evaluate this in the future. You might also submit this as a feature request in our Connect Portal.
https://connect.microsoft.com/VisualStudio/
Again, thank you for your feedback.
Regards,
Rong-Chun Zhang
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact
msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.