You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add default support for WasmHttpHandler using mono-wasm selector #161
kind/enhancementNew feature or requestplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/non-ui ⚙️Categorizes an issue or PR as relevant to winrt (non-ui)
System.NullReferenceException: Object reference not set to an instance of an object. at CameraCaptureUISample.Wasm.Program.Main (System.String[] args) <0x1cc8f18 + 0x00054> in <4b48b7a454c54034a15176c7464ed9b3>:0
System.Exception: NetworkError when attempting to fetch resource. at Uno.Threading.FastTaskCompletionSource1[T].GetResult () <0x2699888 + 0x0005e> in <4f734568ee5d4fc882e3c02b78c0cf28>:0 at Uno.Threading.FastTaskCompletionSource1[T].CreateAsyncTask () <0x25cd998 + 0x000a4> in <4f734568ee5d4fc882e3c02b78c0cf28>:0 at Uno.UI.Wasm.WasmHttpHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) <0x2588430 + 0x0057e> in <98b54d8c3c2044068638992450330dc8>:0 at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) <0x25737a8 + 0x00182> in <73181a0c3a9143aba3405a65287fbca2>:0 at CameraCaptureUISample.MainPage.MainPage_Loaded (System.Object sender, Windows.UI.Xaml.RoutedEventArgs e) <0x25626e8 + 0x000f0> in :0
kind/enhancementNew feature or requestplatform/wasm 🌐Categorizes an issue or PR as relevant to the WebAssembly platformproject/non-ui ⚙️Categorizes an issue or PR as relevant to winrt (non-ui)
Activity
jeromelaban commentedon Nov 28, 2018
Here's a sample code to use the mono backdoor for setting the default HttpMessageHandler:
MelbourneDeveloper commentedon Feb 18, 2019
@jeromelaban , I can't get HttpClient to work. In .NET Core, this code works:
I tried this in Uno:
Exception:
and
Exception:
D-R-R commentedon Mar 4, 2019
In addition to getting the above method with making
Uno.UI.Wasm.WasmHttpHandlerthe default via reflection working, I've also had success with theWasmHttpMessageHandlerthat ships with Mono:https://github.com/mono/mono/blob/master/sdks/wasm/framework/src/WebAssembly.Net.Http/WasmHttpMessageHandler.cs
There is code to configure it automatically (so no need for private reflection), although that didn't work for me out-of-the-box:
https://github.com/mono/mono/blob/master/mcs/class/System.Net.Http/System.Net.Http/HttpClient.wasm.cs
It turned out that it was being linked away and I just needed to add this to
LinkerConfig.xmlto preserve it:12 remaining items
Merge pull request unoplatform#161 from unoplatform/pj/fix-package
Merge pull request unoplatform#161 from unoplatform/dev/agzi/UpdateCa…