ClickOnce смена url установки

188
07 апреля 2018, 19:39

Добрый день. В ClickOnce пытаюсь консольно сменить Installation Folder

Для этих целей есть класс, который создает тестовый манифест, где меняет его DeploymentUrl

   public static void UpdateURL(/*string certificatePassword, string certificateFilePath,*/ /*string manifestFilePath,*/ string url)
    {
        var manifestFilePath = @"c:\Tests\OwinSelfHostSample.application";
        string password = "Password";
        // Open the deployment file (.application)
        DeployManifest deployManifest = ManifestReader.ReadManifest(manifestFilePath, false) as DeployManifest;
        // Set the URL to the new url:
        deployManifest.DeploymentUrl = url;
        // Create a new manifest file (in a temp folder)
        string tempFileName = @"c:\Tests\newManifest.application";
        ManifestWriter.WriteManifest(deployManifest, tempFileName);
        // Sign the certificate again
        string certFilePath = @"c:\users\hobrus\source\repos\OwinSelfHostSample\OwinSelfHostSample\OwinSelfHostSample_TemporaryKey.pfx";
        // Make sure the entered cert file exists
        if (File.Exists(certFilePath))
        {
            // Construct cert object for cert
            X509Certificate2 cert;
            if (string.IsNullOrEmpty(password))
            {
                cert = new X509Certificate2(certFilePath);
            }
            else
            {
                cert = new X509Certificate2(certFilePath, password);
            }
            SecurityUtilities.SignFile(cert, null, tempFileName);
            Console.WriteLine("Signed! new file: " + tempFileName);
        }
    }
}

Но в итоге падает с ошибкой

ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Tests\OwinSelfHostSample.application resulted in exception. Following failure messages were detected:
+ You cannot start application OwinSelfHostSample from this location because it is already installed from a different location.
+ You cannot start application OwinSelfHostSample from location file:///C:/Tests/OwinSelfHostSample.application it is already installed from location http://f15535be.ngrok.io/OwinSelfHostSample.application. You can start it from location http://f15535be.ngrok.io/OwinSelfHostSample.application or you can uninstall it and reinstall it from location file:///C:/Tests/OwinSelfHostSample.application. If you reinstall the application, be aware that you might lose any customizations that you made to the application.

В чем может быть проблема?

READ ALSO
Установка WPF Themes

Установка WPF Themes

Скачал стили панели элементов windows form C# для visual studio, но не знаю куда кидать файлыКачал отсюда-->WPF Themes

149
Как создать универсальный класс

Как создать универсальный класс

Подскажите пожалуйста! Я в DataSet ResultData гружу данные из БДА затем выбираю их в массив, который потом прикручиваю к комбобоксу в качестве источника...

199
Отрисовка фигуры в pictureBox

Отрисовка фигуры в pictureBox

Пытаюсь нарисовать многоугольник внутри pictureBox1, но он не выводится, ниже приведет листинг, что я делаю не так или же как правильно вызвать...

197
Защита APK Unity

Защита APK Unity

При взломе APK и последующей перепаковке взломщик гарантированно теряет старую подпись и ему нужно переподписать APK другим ключем, верно?

145