DeploymentDownloadException クラスとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DeploymentDownloadException クラスの意味・解説 

DeploymentDownloadException クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

ClickOnce マニフェストまたは配置ファイルクライアント コンピュータダウンロードする際にエラー発生したことを示します

名前空間: System.Deployment.Application
アセンブリ: System.Deployment (system.deployment.dll 内)
構文構文

<SerializableAttribute> _
Public Class DeploymentDownloadException
    Inherits DeploymentException
Dim instance As DeploymentDownloadException
[SerializableAttribute] 
public class DeploymentDownloadException :
 DeploymentException
[SerializableAttribute] 
public ref class DeploymentDownloadException
 : public DeploymentException
/** @attribute SerializableAttribute() */ 
public class DeploymentDownloadException extends
 DeploymentException
SerializableAttribute 
public class DeploymentDownloadException extends
 DeploymentException
解説解説
使用例使用例

アプリケーション更新同期的インストールし、マニフェストまたは配置ファイルダウンロードする際に問題発生したかどうかユーザー報告するコード例次に示します

Private Sub InstallUpdateSync()
    If (ApplicationDeployment.IsNetworkDeployed) Then
        Dim updateAvailable As Boolean
 = False
        Dim AD As ApplicationDeployment = ApplicationDeployment.CurrentDeployment

        Try
            updateAvailable = AD.CheckForUpdate()
        Catch dde As DeploymentDownloadException
            ' This exception occurs if a network error or disk error
 occurs
            ' when downloading the deployment.
            MessageBox.Show("The application cannot check for
 the existence of a new version at this time. " + ControlChars.Lf +
 ControlChars.Lf + "Please check your network connection, or try again later. Message: " + dde.Message)
            Exit Sub
        Catch ide As InvalidDeploymentException
            MessageBox.Show("The application cannot check for
 an update. The ClickOnce deployment is corrupt. Please redeploy the application
 and try again. Message: " + ide.Message)
            Exit Sub
        Catch ioe As InvalidOperationException
            MessageBox.Show("The application cannot check for
 an update. This most likely happened because the application is already updating.
 Message: " + ioe.Message)
            Exit Sub
        End Try

        If (updateAvailable) Then
            Try
                AD.Update()
                MessageBox.Show("The application has been upgraded,
 and will now restart.")
                Application.Restart()
            Catch dde As DeploymentDownloadException
                MessageBox.Show("Cannot install the latest version
 of the application. " + ControlChars.Lf + ControlChars.Lf + "Please
 check your network connection, or try again later.")
            End Try
        End If
    End If
End Sub
private void InstallUpdateSync()
{
    if (ApplicationDeployment.IsNetworkDeployed)
    {
        Boolean updateAvailable = false;
        ApplicationDeployment ad = ApplicationDeployment.CurrentDeployment;

        try
        {
            updateAvailable = ad.CheckForUpdate();
        }
        catch (DeploymentDownloadException dde)
        {
            // This exception occurs if a network error or disk error
 occurs
            // when downloading the deployment.
            MessageBox.Show("The application cannt check for
 the existence of a new version at this time.
 \n\nPlease check your network connection, or try again later. Error: " + dde);
            return;
        }
        catch (InvalidDeploymentException ide)
        {
            MessageBox.Show("The application cannot check for
 an update. The ClickOnce deployment is corrupt. Please redeploy the application
 and try again. Error: " + ide.Message);
            return;
        }
        catch (InvalidOperationException ioe)
        {
            MessageBox.Show("This application cannot check for
 an update. This most often happens if the application is already
 in the process of updating. Error: " + ioe.Message);
            return;
        }

        if (updateAvailable)
        {
            try
            {
                ad.Update();
                MessageBox.Show("The application has been upgraded, and will
 now restart.");
                Application.Restart();
            }
            catch (DeploymentDownloadException dde)
            {
                MessageBox.Show("Cannot install the latest version of the application.
 Either the deployment server is unavailable, or your network connection is down.
 \n\nPlease check your network connection, or try again later. Error: " + dde.Message);
            }
            catch (TrustNotGrantedException tnge)
            {
                MessageBox.Show("The application cannot be updated. The system
 did not grant the application the appropriate level of trust. Please contact your
 system administrator or help desk for further troubleshooting. Error: " + tnge.Message);
            }
        }
    }
}
public:
    void LaunchUpdateWithTimeout()
    {
        if (ApplicationDeployment::IsNetworkDeployed)
        {
            ApplicationDeployment^ appDeployment =
                ApplicationDeployment::CurrentDeployment;
            appDeployment->UpdateCompleted +=
                gcnew AsyncCompletedEventHandler(this, 
                &Form1::deploy_UpdateCompleted);

            // The Interval property uses millisecond resolution.
            timer1->Interval = (1000 * 60) * 2;
            timer1->Start();

            appDeployment->UpdateAsync();
        }
    }

private:
    void deploy_UpdateCompleted(Object^ sender,
        AsyncCompletedEventArgs^ e)
    {
        timer1->Stop();
        if (!e->Cancelled)
        {
            if (nullptr == e->Error)
            {
                Application::Restart();
            }
            else
            {
                // Replace with your own error reporting or logging.
                MessageBox::Show(
                    "The update of the application encountered an " +
                    "error. Error message: {0}",
                    e->Error->Message);
            }
        }
        else
        {
            // Replace with your own error reporting or logging.
            MessageBox::Show(
                "The application update was cancelled because the update "
 +
                "server was unreachable. Please try again
 later.");
        }
    }

private:
    void timer1_Tick(Object^ sender, EventArgs^ e)
    {
        if (ApplicationDeployment::IsNetworkDeployed)
        {
            ApplicationDeployment::CurrentDeployment->UpdateAsyncCancel();
        }
    }
継承階層継承階層
System.Object
   System.Exception
     System.SystemException
       System.Deployment.Application.DeploymentException
        System.Deployment.Application.DeploymentDownloadException
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「DeploymentDownloadException クラス」の関連用語

DeploymentDownloadException クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DeploymentDownloadException クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS