ConsoleApplicationBase.Deployment Eigenschaft
Definition
Ruft das Objekt für die ClickOnce-Bereitstellung der aktuellen Anwendung ab, das das programmgesteuerte Aktualisieren der aktuellen Bereitstellung sowie den Download von Dateien bei Bedarf unterstützt.Gets the current application's ClickOnce deployment object, which provides support for updating the current deployment programmatically and support for the on-demand download of files.
public:
property System::Deployment::Application::ApplicationDeployment ^ Deployment { System::Deployment::Application::ApplicationDeployment ^ get(); };
public System.Deployment.Application.ApplicationDeployment Deployment { get; }
member this.Deployment : System.Deployment.Application.ApplicationDeployment
Public ReadOnly Property Deployment As ApplicationDeployment
Eigenschaftswert
Das ApplicationDeployment -Objekt für die ClickOnce-Bereitstellung der Anwendung.The ApplicationDeployment object for the application's ClickOnce deployment.
Ausnahmen
Die Anwendung wird nicht als ClickOnce-Anwendung bereitgestellt.The application is not deployed as a ClickOnce application.
Beispiele
In diesem Beispiel wird das Update heruntergeladen und installiert, nachdem überprüft wurde, ob die Anwendung vom Netzwerk bereitgestellt wurde.This example downloads and installs the update after checking that the application is network-deployed. Die- Update Methode aktualisiert die Anwendung nicht, es sei denn, Sie ist veraltet.The Update method does not update the application unless it is out of date. Die Anwendung muss neu gestartet werden, um das Update zu verwenden.The application has to restart to use the update.
Sub UpdateApplication()
If My.Application.IsNetworkDeployed Then
My.Application.Deployment.Update()
End If
End Sub
Nur Anwendungen, die mit ClickOnce bereitgestellt werden, können mithilfe des-Objekts aktualisiert werden My.Application.Deployment
.Only applications that are ClickOnce deployed can be updated using the My.Application.Deployment
object. Weitere Informationen zum Bereitstellen einer ClickOnce-Anwendung finden Sie unter Gewusst wie: Veröffentlichen einer ClickOnce-Anwendung mit dem Webpublishing-Assistenten.For more information on deploying a ClickOnce application, see How to: Publish a ClickOnce Application using the Publish Wizard.
Hinweise
Die My.Application.Deployment
-Eigenschaft gibt das ClickOnce-Objekt der Anwendung zurück ApplicationDeployment .The My.Application.Deployment
property returns the application's ClickOnce ApplicationDeployment object. Das- ApplicationDeployment Objekt unterstützt das programmgesteuerte Aktualisieren der aktuellen Bereitstellung sowie die Unterstützung für den bedarfsgesteuerten Download von Dateien.The ApplicationDeployment object provides support for updating the current deployment programmatically as well as support for the on-demand download of files. Weitere Informationen zu ClickOnce-Anwendungen und deren Bereitstellung finden Sie unter ClickOnce-Sicherheit und-Bereitstellung und Veröffentlichen von ClickOnce-Anwendungen.For more information on ClickOnce applications and how to deploy them, see ClickOnce Security and Deployment and Publishing ClickOnce Applications.
Vergewissern Sie sich, dass die- IsNetworkDeployed Eigenschaft True
vor dem Zugriff auf die My.Application.Deployment
Eigenschaft ist.Confirm that the IsNetworkDeployed property is True
before you access the My.Application.Deployment
property. Andernfalls führt das Lesen der My.Application.Deployment
Eigenschaft zu einer Ausnahme, wenn die Anwendung nicht mithilfe von ClickOnce bereitgestellt wird InvalidDeploymentException .Otherwise, if the application is not deployed using ClickOnce, reading the My.Application.Deployment
property results in an InvalidDeploymentException exception. Weitere Informationen zum Bereitstellen einer ClickOnce-Anwendung finden Sie unter Gewusst wie: Veröffentlichen einer ClickOnce-Anwendung mit dem Webpublishing-Assistenten.For more information on deploying a ClickOnce application, see How to: Publish a ClickOnce Application using the Publish Wizard.
Weitere Informationen zur Verwendung der- My.Application.Deployment
Eigenschaft finden Sie unter Übersicht über das Visual Basic-Anwendungsmodell.For more information on using the My.Application.Deployment
property, see Overview of the Visual Basic Application Model.
Verfügbarkeit nach ProjekttypAvailability by Project Type
ProjekttypProject type | VerfügbarAvailable |
---|---|
Windows Forms-AnwendungWindows Forms Application | JaYes |
KlassenbibliothekClass Library | NeinNo |
KonsolenanwendungConsole Application | JaYes |
Windows Forms-SteuerelementbibliothekWindows Forms Control Library | NeinNo |
WebsteuerelementbibliothekWeb Control Library | NeinNo |
Windows-DienstWindows Service | JaYes |
WebsiteWeb Site | NeinNo |
Gilt für:
Siehe auch
- ApplicationDeployment
- Objekte (Visual Basic)Objects (Visual Basic)
- Übersicht über das Visual Basic-AnwendungsmodellOverview of the Visual Basic Application Model
- Gewusst wie: Veröffentlichen einer ClickOnce-AnwendungHow to: Publish a ClickOnce Application
- Veröffentlichen von ClickOnce-AnwendungenPublish ClickOnce applications