简体   繁体   English

从Visual Studio发布到特定网站?

[英]Publish from Visual Studio to a specific web site?

I have a C# project that I am developing with Visual Studio and am deploying with Click-Once. 我有一个C#项目,正在使用Visual Studio开发并通过Click-Once进行部署。 There's nothing fancy about that. 没什么好看的。

However, I'm wondering if it's possible to include the intended deployment path within a config file or something else? 但是,我想知道是否可以在配置文件或其他内容中包含预期的部署路径? I know that the last deployed URL is kept in the history of the project, but what if I want to dynamically set this and have the Click Once deployment read from the project config file? 我知道上次部署的URL保留在项目的历史记录中,但是如果我要动态设置它并从项目配置文件中读取“单击一次”部署,该怎么办?

Part of the identity of a ClickOnce application is the URL from whence it is installed. ClickOnce应用程序身份的一部分是安装该应用程序的URL。 So you can not install an application from one URL and then install it from another URL and have it work. 因此,您不能从一个URL安装应用程序,然后再从另一个URL安装应用程序并使其正常工作。 The only way to modify the deployment provider URL is to change it in the deployment manifest (yourapp.application) and re-sign the manifest with the original certificate using Mage or MageUI. 修改部署提供程序URL的唯一方法是在部署清单(yourapp.application)中对其进行更改,然后使用Mage或MageUI用原始证书对清单进行重新签名。

We deploy our application to a DNS entry that points to a folder on our website. 我们将应用程序部署到指向我们网站上文件夹的DNS条目。 This way, if we want to move it, we can just re-point the DNs entry to a different IP address and not impact the deployment. 这样,如果我们要移动它,我们只需将DN条目重新指向另一个IP地址,而不会影响部署。

You can actually deploy your application with no url in it. 实际上,您可以在没有URL的情况下部署应用程序。 When the user installs it, it will save the url it was installed from and use that as the deployment provider URL. 当用户安装它时,它将保存从中安装的URL,并将其用作部署提供程序URL。

I'm not sure what you're trying to accomplish; 我不确定您要完成什么; more information might help me help you come up with a way to accomplish what you're trying to do if none of the above is helpful. 如果以上方法均无济于事,更多的信息可能会帮助我帮助您找到一种方法来完成您要完成的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM