简体   繁体   English

使用HttpClient的ClickOnce WPF应用程序

[英]ClickOnce WPF application using HttpClient

I have a WPF application that I plan to distribute with ClickOnce. 我有一个计划与ClickOnce一起分发的WPF应用程序。 I have developed for several months and I am now ready to launch. 我已经开发了几个月,现在可以开始发布了。 Everything works fine on developer computer with Windows 7, .Net Framework 4.51 and VS 2013. 在装有Windows 7,.Net Framework 4.51和VS 2013的开发人员计算机上,一切正常。

But now I test on other computers. 但是现在我在其他计算机上进行测试。 The application start is still fine, but right after start the next step is to synchronize with web server and download initial content. 应用程序启动仍然可以,但是启动之后,下一步就是与Web服务器同步并下载初始内容。 There it crashes immediately! 在那里,它立即崩溃!

Windows gives me some problem information before application is shut down: Windows在关闭应用程序之前向我提供了一些问题信息:

    Problem name:               CLR20r3
    Problem signature 01:       myapplication.exe
    Problem signature 02:       0.1.0.0
    Problem signature 03:       54b1359b
    Problem signature 04:       System
    Problem signature 05:       4.0.30319.34238
    Problem signature 06:       53e450ed
    Problem signature 07:       2f90
    Problem signature 08:       15d
    Problem signature 09:       System.Net.Http.HttpRequest
    OS version:                 6.1.7601.2.1.0.256.48
    Language variant-ID:        1053
    Further information 1:      0a9e
    Further information 2:      0a9e372d3b4ad19135b953a78882e789
    Further information 3:      0a9e
    Further information 4:      0a9e372d3b4ad19135b953a78882e789

(The left column is translated from Swedish by me for readability) (为便于阅读,左栏由我从瑞典语翻译而来)

I searched for hints but find nothing that helped. 我搜索了提示,但没有找到任何帮助。

Test computer has Windows 7 and .Net Framework 4.51. 测试计算机具有Windows 7和.Net Framework 4.51。 Same problem occurs on Windows 8.1. Windows 8.1上也会发生相同的问题。

System.Net.Http.HttpRequest exists in Windows\\Microsoft.NET\\Framework\\v4.0.30319 as expected. System.Net.Http.HttpRequest存在Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319中,如预期的那样。

Can I configure Fiddler to detect traffic sent from .Net client? 我可以配置Fiddler来检测从.Net客户端发送的流量吗? As for now no traffic is detected on neither machine. 目前,两台计算机上均未检测到流量。

Any hints are appreciated!! 任何提示表示赞赏!

By checking for specific HttpRequestException I now found this in inner Exception: "Unable to connect to the remote server" 通过检查特定的HttpRequestException,我现在在内部异常中发现了这一点:“无法连接到远程服务器”

I have created an Azure website the standard way and from the WPF client I call a WebApi. 我已经以标准方式创建了一个Azure网站,并从WPF客户端中将其称为WebApi。 ClickOnce is configured with "This is full trust application". ClickOnce配置为“这是完全信任的应用程序”。

The same call is made from on both computers. 在两台计算机上都发出相同的呼叫。 The computers are on the same local network. 这些计算机在同一本地网络上。 Does the existance of Visual Studio on the machine make a difference? 机器上存在Visual Studio会有所不同吗?

To order to Fiddler to capture traffic add following configuration in your client program' config file or you may choose programmatic option to add it if you like. 为了使Fiddler捕获流量,请在客户端程序的配置文件中添加以下配置,或者您可以选择编程选项添加它。

<system.net>
    <defaultProxy enabled = "true" useDefaultCredentials = "true">
       <proxy autoDetect="false" bypassonlocal="false" proxyaddress="http://127.0.0.1:8888"  usesystemdefault="false" />
    </defaultProxy>
</system.net>

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

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