ClickOnce Hello World不工作 [英] ClickOnce Hello World not working
问题描述
我有一个WPF默认应用程序空的窗口)
这是我做的:
- 打开项目属性。
- 打开发布向导。
- 选择本地服务器。我使用Visual Studio(File / New / WebSite)创建了一个网站,然后我可以从列表中选择它。我使用了一个名为 Test1 的
- 然后选择说明应用程序将在线和离线可用
- 发布
- 现在我运行ISS Express服务器,然后转到
http: /localhost:6507/publish.htm
,如下所示:
- 我点击发布按钮并下载 setup.exe 。
- 但是当我启动 setup.exe 时,我收到以下错误:
-
日志是:
以下属性已设置:
属性:[AdminUser] = true {boolean}
属性:[InstallMode] = HomeSite {string}
Pro perty:[NTProductType] = 1 {int}
属性:[ProcessorArchitecture] = AMD64 {string}
属性:[VersionNT] = 6.2.0 {版本}
运行检查包Microsoft .NET Framework 4.5(x86和x64)',阶段BuildList
读取注册表项'版本''HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
读取字符串值'4.5.50938'
属性'DotNet45Full_TargetVersion'设置值'4.5.50938 {string}'
为Microsoft .NET Framework 4.5(x86和
属性:[DotNet45Full_TargetVersion] = 4.5.50938 {string}
运行检查命令'DotNetFX45\dotNetFx45_Full_x86_x64.exe'
运行运算符'ValueEqualTo'在属性上的结果' InstallMode'和值'HomeSite':true
命令'DotNetFX45\dotNetFx45_Full_x86_x64.exe'的检查结果是'Bypass'
运行检查的逗号d'DotNetFX45\dotNetFx45_Full_setup.exe'
属性InstallMode和值HomeSite上运行运算符ValueNotEqualTo的结果:false
运行运算符VersionGreaterThanOrEqualTo对属性DotNet45Full_TargetVersion和值的结果'4.5.50709':true
命令'DotNetFX45\dotNetFx45_Full_setup.exe'的检查结果为'Bypass'
'Microsoft .NET Framework 4.5(x86和x64)'RunCheck结果:无需安装
启动应用程序。
URLDownloadToCacheFile失败,HRESULT'-2146697208'
错误:尝试下载http:// agarwaen-pc:6507 / WpfApplication1.application时出错。
我被卡住了,因为它的Hello World示例并不工作。我需要部署一个复杂得多的项目。
任何帮助将不胜感激。
提前感谢。
PD:我认为错误的原因可能是我正在使用的服务器。我的意思是我只是指向一个有发布页面的项目,然后右键单击在浏览器中显示来启动ISS服务器。也许安装程序无法下载所需的文件,因为服务器没有提供这些文件。
编辑:
我转到不是Express版本的ISS,而 setup.exe 文件现在成功下载。现在,当应用程序尝试下载剩余的文件时,我会收到另一个下载错误。消息说不能连接,因为目标机器主动拒绝它
消息是:
PLATFORM VERSION INFO
Windows:6.2.9200.0(Win32NT)
公共语言运行时:4.0.30319.18408
System.Deployment.dll :4.0.30319.17929建立于:FX45RTMREL
clr.dll:4.0.30319.18408建立于:FX451RTMGREL
dfdll.dll:4.0.30319.17929建立于:FX45RTMREL
dfshim.dll:4.0.41209.0( Main.041209-0000)
SOURCES
部署URL:http://agarwaen-pc/WpfApplication1.application
服务器:Microsoft-IIS / 8.0
部署提供程序url:http:// agarwaen-pc:6507 / WpfApplication1.application
错误摘要
以下是错误的摘要,这些错误的详细信息将在日后列出。
*激活http://agarwaen-pc/WpfApplication1.application导致异常。检测到以下失败消息:
+下载http:// agarwaen-pc:6507 / WpfApplication1.application没有成功。
+无法连接到远程服务器
+无法建立连接,因为目标机器主动拒绝它10.6.53.219:6507
组件存储事务失败概要
未检测到事务错误。
WARNINGS
此操作中没有警告。
操作进度状态
* [4/25/2014 12:15:27 AM]:激活http://agarwaen-pc/WpfApplication1.application已启动。
错误详细信息
在此操作期间检测到以下错误。
* [4/25/2014 12:15:33 AM] System.Deployment.Application.DeploymentDownloadException(未知子类型)
- 下载http:// agarwaen-pc:6507 / WpfApplication1.application没有成功。
- 来源:System.Deployment
- 堆栈跟踪:
在System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(NextQueueItem next)
在System.Deployment.Application.SystemNetDownloader.DownloadAllFiles ()
在System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
在System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri,String targetPath,IDownloadNotification通知,DownloadOptions选项,ServerInformation& serverInformation)
在System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri,String targetPath,IDownloadNotification通知,DownloadOptions选项,ManifestType清单类型,服务器信息和服务器信息)
在System.Deployment.Application.DownloadManager。 DownloadDeploymentManifestDirect(SubscriptionStore subStore,Uri& sourc eUri,TempFile& tempFile,IDownloadNotification通知,DownloadOptions选项,ServerInformation& serverInformation)
在System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore,AssemblyManifest&部署,Uri& sourceUri,TempFile& tempFile,IDownloadNotification通知,DownloadOptions选项)
在System.Deployment.Application.DownloadManager .DownloadDeploymentManifestBypass(SubscriptionStore subStore,Uri& sourceUri,TempFile& tempFile,SubscriptionState& subState,IDownloadNotification通知,DownloadOptions选项)
在System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri,Boolean isShortcut,String textualSubId,String deploymentProviderUrlFromExtension ,BrowserSettings browserSettings,String& errorPageUrl)
在System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(对象状态)
---内部异常---
System.Net.WebException
- 无法连接到远程服务器
- 来源:System
- 堆栈跟踪:
在System.Net.HttpWebRequest.GetResponse()
在System.Deployment.Application.SystemNetDownloader .DownloadSingleFile(NextQueueItem next)
---内部异常---
System.Net.Sockets.SocketException
- 无法建立连接,因为目标机器主动拒绝它10.6.53.219: 6507
- 来源:系统
- 堆栈跟踪:
在System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress socketAddress)
在System.Net.ServicePoint.ConnectSocketInternal (布尔连接失败,Socket s4,Socket s6,Socket&套接字,IP地址&地址,ConnectSocketState状态,IAsyncResult asyncResult,Exception&例外)
组件存储交易详情
没有交易信息可用。
这是ClickOnce部署的一般问题。您不能将ClickOnce应用程序发布到您的本地主机,并从那里下载。我认为问题是关于一些内部Windows DNS /名称解析,它将 localhost
转换为 your-pc:1234
总是。几个月前我也有同样的问题,因为我试图将我的应用程序发布到本地主机。现在没有找到解决办法了。在本地,您将需要作为脱机包进行部署。您只能使用实际在线的服务器,使用在线部署(从 http:// ...
更新)。不过,您可以尝试使用UNC路径(例如 \\ServerInNetwork\Deployment\
)来测试更新过程。
UNC和Web之间的更新行为是一样的。
另一个主题,可能有助于您。
I read some documentation about how to do ClickOnce deployment and now I'm trying to deploy a hello world application.
I have a WPF default application (just an empty window).
This is what I do:
- Open project properties.
- Open publish wizard.
- Select a local server. I created a website using Visual Studio (File/New/WebSite) and then I can select it from the list. I used the one named Test1.
- Then select the option that says The application will be available online and offline
- Publish
- Now I run the ISS Express server and go to
http://localhost:6507/publish.htm
that look like this:
- I hit the publish button and download setup.exe.
- But when I start setup.exe I get the following error:
And the log is:
The following properties have been set: Property: [AdminUser] = true {boolean} Property: [InstallMode] = HomeSite {string} Property: [NTProductType] = 1 {int} Property: [ProcessorArchitecture] = AMD64 {string} Property: [VersionNT] = 6.2.0 {version} Running checks for package 'Microsoft .NET Framework 4.5 (x86 and x64)', phase BuildList Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full' Read string value '4.5.50938' Setting value '4.5.50938 {string}' for property 'DotNet45Full_TargetVersion' The following properties have been set for package 'Microsoft .NET Framework 4.5 (x86 and x64)': Property: [DotNet45Full_TargetVersion] = 4.5.50938 {string} Running checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true Result of checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' is 'Bypass' Running checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet45Full_TargetVersion' and value '4.5.50709': true Result of checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' is 'Bypass' 'Microsoft .NET Framework 4.5 (x86 and x64)' RunCheck result: No Install Needed Launching Application. URLDownloadToCacheFile failed with HRESULT '-2146697208' Error: An error occurred trying to download `http://agarwaen-pc:6507/WpfApplication1.application`.
I'm stuck with this because its a Hello World example and is not working. I need to deploy a project that is far more complex. Any help will be appreciated. Thanks in advance.
PD: I'm thinking that the reason of the error may be the server that I'm using. I mean that I just point to a project that has the publish page and then right click Show in browser to start the ISS server. Maybe the setup program cannot download the required files because the server isn't serving those.
EDIT: I moved to not Express version of ISS and the setup.exe file now downloads successfully. Now I get another download error when the application is trying to download the remaining files. The message says No connection could be made because the target machine actively refused it
The message is:
PLATFORM VERSION INFO
Windows : 6.2.9200.0 (Win32NT)
Common Language Runtime : 4.0.30319.18408
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.18408 built by: FX451RTMGREL
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES
Deployment url : http://agarwaen-pc/WpfApplication1.application
Server : Microsoft-IIS/8.0
Deployment Provider url : http://agarwaen-pc:6507/WpfApplication1.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of http://agarwaen-pc/WpfApplication1.application resulted in exception. Following failure messages were detected:
+ Downloading http://agarwaen-pc:6507/WpfApplication1.application did not succeed.
+ Unable to connect to the remote server
+ No connection could be made because the target machine actively refused it 10.6.53.219:6507
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [4/25/2014 12:15:27 AM] : Activation of http://agarwaen-pc/WpfApplication1.application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [4/25/2014 12:15:33 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://agarwaen-pc:6507/WpfApplication1.application did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadManifest(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ManifestType manifestType, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- Unable to connect to the remote server
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
--- Inner Exception ---
System.Net.Sockets.SocketException
- No connection could be made because the target machine actively refused it 10.6.53.219:6507
- Source: System
- Stack trace:
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
This is a general issue with ClickOnce deployment. You CANNOT publish a ClickOnce app to your localhost and download it from there. I think the issue is about some internal Windows DNS/name resolving, which converts localhost
to your-pc:1234
- always. I had the same issue a few months ago, as I tried to publish my app to localhost. There's by now no workaround that I found. Locally, you would need to deploy as an offline package. You can use the online deployment (update from http://...
) only with a server that is actually online. Nevertheless, you might try to use a UNC path (like \\ServerInNetwork\Deployment\
) for testing the update process.
The update behavior between UNC and Web is the same.
Another topic that may help you.
这篇关于ClickOnce Hello World不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!