示例#1
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            X509Store store = new X509Store(StoreLocation.CurrentUser);

            store.Open(OpenFlags.ReadOnly);
            var x509Certificate2 = store.Certificates.Find(X509FindType.FindBySubjectName, "TestProgramm", false).OfType <X509Certificate2>().First();
            var deployment       = new Deployment(new Uri(updateUri.Text));

            deployment.Logger = new DebugLogger();
            deployment.SignaturePrivateCertificate = x509Certificate2;
            var updateInfo = await deployment.CreateUpdateInfoAsync(".", "Initial", Version.Parse("1.0.1.0"));

            var deployed = await deployment.DeployAsync(updateInfo, new NetworkCredential("zok", pwBox.Text));
        }