.net - 将 ClickOnce wpf 应用程序部署到 Windows Azure Blob 存储

标签 .net wpf visual-studio-2012 azure clickonce

我有一个 WPF 应用程序,想要将其部署到 Windows Azure 存储中的公共(public)容器。

我尝试过的:

<强>1。发布VISUAL STUDIO 2012向导

我尝试直接从 Visual Studio 2012 中的 ClickOnce 发布向导使用容器 URL。我收到以下错误:

Failed to connect to with the following error: Unable to create the Web site The Web server does not appear to have FrontPage Server Extensions installed. If FrontPage Server Extensions are installed, this error can occur because the _vti_bin virtual directory is not marked as executable. To correct this problem, run Internet Information Services Manager, select the Web server that has the problem, and then use the Check Server Extensions command

<强>2。添加工具

经过一番研究,我认为我需要安装 2012 Visual Studio Authoring Extensions 。这并没有解决问题。

进一步的研究表明,直接使用带有博客存储 URL 的发布向导是行不通的。

<强>3。第三方上传工具

所以我所做的就是发布到计算机上的本地文件,然后使用工具将这些文件上传到 blob 存储。 (我用过AZURE EXPLORER)

将本地发布文件夹的全部内容上传到 Azure Blob 存储后,我在浏览器中请求了 Blob 存储 URL,但没有执行任何操作,因此我使用了该 URL 并以 setup.exe 结尾。该文件是下载到本地并运行的。这产生了错误。我也尝试使用 .Application 文件并得到相同的错误。

<强>4。重新上传

我再次上传文件,覆盖当前文件,认为它们第一次可能会被损坏。这并没有解决它。

<强>5。尝试过 SETUP.EXE、PUBLISH.HTM 和 APPNAME.APPLICATION

如果我使用 setup.exe、publish.htm 或 appname.application 文件,也会生成相同的错误。


开始编辑#2

<强>6。确认 MIME 类型和 .DEPLOY 扩展

阅读评论中 @Gaurav Mantri 建议的文章后,我确认我的发布选项已选中将 .deploy 添加到 dll 的选项,并且我还确认按照 this article about ClickOnce MIME types 使用了正确的 MIME 类型。 。 这些设置已经正确就位,所以不能解决我的问题。

结束编辑#2


错误:

以下是我在尝试从 Azure Blob 存储运行 setup.exe 文件时遇到的错误:

ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of C:\Users\Jordan\Downloads\FTC_Application (1).application resulted in exception. Following failure messages were detected: + Downloading http://******/FTC_Application/FTC_Application.application did not succeed. + The remote server returned an error: (500) Internal Server Error.

COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected.

WARNINGS There were no warnings during this operation.

OPERATION PROGRESS STATUS * [10/5/2013 9:39:52 AM] : Activation of C:**********\Downloads\FTC_Application (1).application has started.

ERROR DETAILS Following errors were detected during this operation. * [10/5/2013 9:39:52 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype) - Downloading http://*********/FTC_Application/FTC_Application.application did not succeed. - Source: System.Deployment - Stack trace: at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
....STACK TRACE DETAILS REMOVED FOR READABILITY................... System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state) --- Inner Exception --- System.Net.WebException - The remote server returned an error: (500) Internal Server Error. - Source: System - Stack trace: at System.Net.HttpWebRequest.GetResponse() at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)

COMPONENT STORE TRANSACTION DETAILS No transaction information is available.

问题:

有人可以帮助我确定为什么我在运行 ClickOnce 部署文件(setup.exe 或 appname.application 或publish.htm)时从 Azure Blob 存储中收到 (500) 内部服务器错误 错误.

第二次编辑后的跟进:问题:这可能是由于项目仅使用 testsign 造成的吗?

更新:

我已确认您无法将内置发布向导与 Azure Blob 存储一起使用。所以需要第三方上传工具。所有文件都可以从 azure blob 容器公开下载。 但如果我使用建议的网址:

http://{AzureAccountName}.blob.core.windows.net/{BlobContainerName}/{ApplicationName}.application

将下载 ApplicationName.application 文件,但是当我单击它时,会生成我上面引用的错误。

最佳答案

你是对的,你不能直接从 Visual Studio 发布到 Blob 存储。您应该能够在本地发布文件并上传它们,如 Gaurav 评论中引用的文章中所述。

话虽如此,请检查 Blob 存储中容器的权限,并确保对 Blob 具有公共(public)读取访问权限。容器可以是私有(private)的,但 blob 不能。您至少应该能够打开publish.htm 文件(假设它位于容器中,而不是位于容器中的文件夹中)。

还要确保您的安装 URL 指向 blob 存储容器的顶部文件夹,这样当它有权访问这些文件时,它就能正确找到这些文件。

要确保不是您的计算机出现问题,请尝试此 link to the publish page我已发布到 Blob 存储的测试 Clickonce 应用程序的示例。

关于.net - 将 ClickOnce wpf 应用程序部署到 Windows Azure Blob 存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19199715/

相关文章:

c# - 如何使用我的可执行文件链接安装 Kinect Runtime?

c# - 以编程方式将 Excel 2003 文件转换为 2007+

c# - 将 Windows 窗体应用程序重构为 MVVM 模式—— future 可能的 WPF 版本

c# - 如何将 Storyboard 用作样式

ajax - 无法加载文件或程序集 'System.Web' 或其依赖项之一。

visual-studio - "C:\Microsoft.Cpp.Default.props"未找到

git - 将 Visual Studio 扩展回滚到早期版本

c# - IIS express : startMode=”AlwaysRunning”

c# - 将数据从 C++ 传递到 C#

c# - 无法创建 Excel.Application 的对象