async-await

Bug when using await/async for System.Net.Http with .NET Core (.NET Standard 1.4 and .NET Framework 4.6.1)?

房东的猫 提交于 2019-12-24 07:02:37
问题 Foreground: I was investigating a bug in an ASP.NET Core project (targeting .NET 4.6.1, using assemblies from .Net Standard 1.4), that threw a MissingMethodException, although this in no way could be possible. Isolating the faulting method, I took the core of the code out to a separate unit test which also targets .NET 4.6.1. The exception I receive, ThreadAbortException , from the unit test is more or less this (it sometime various): at System.Net.Http.WinHttpHandler

Bug when using await/async for System.Net.Http with .NET Core (.NET Standard 1.4 and .NET Framework 4.6.1)?

喜你入骨 提交于 2019-12-24 07:02:17
问题 Foreground: I was investigating a bug in an ASP.NET Core project (targeting .NET 4.6.1, using assemblies from .Net Standard 1.4), that threw a MissingMethodException, although this in no way could be possible. Isolating the faulting method, I took the core of the code out to a separate unit test which also targets .NET 4.6.1. The exception I receive, ThreadAbortException , from the unit test is more or less this (it sometime various): at System.Net.Http.WinHttpHandler

Not reach the code as expected

蹲街弑〆低调 提交于 2019-12-24 06:55:52
问题 I have a telephony application, in which I want to invoke simultaneous calls,. Each call will occupy a channel or port. So I added all channels to a BlockingCollection. The application is a windows service. Let's see the code. public static BlockingCollection<Tuple<ChannelResource, string>> bc = new BlockingCollection<Tuple<ChannelResource, string>>(); public static List<string> list = new List<string>();// then add 100 test items to it. The main application has the code: while (true) {

Not reach the code as expected

与世无争的帅哥 提交于 2019-12-24 06:53:07
问题 I have a telephony application, in which I want to invoke simultaneous calls,. Each call will occupy a channel or port. So I added all channels to a BlockingCollection. The application is a windows service. Let's see the code. public static BlockingCollection<Tuple<ChannelResource, string>> bc = new BlockingCollection<Tuple<ChannelResource, string>>(); public static List<string> list = new List<string>();// then add 100 test items to it. The main application has the code: while (true) {

W8.1 Live SDK 5.6 - LiveAuthClient.InitializeAsync System.NullReferenceException

空扰寡人 提交于 2019-12-24 06:42:50
问题 I'm developing a Windows 8.1 App (XAML/C#) with MVVM Light. I used to keep my LiveId inside the code just for debugging, but now it's time to do the LogIn. Currently i'm stuck with this piece of code: this.authClient = new LiveAuthClient(); LiveLoginResult loginResult = await this.authClient.InitializeAsync(scopes); It keeps giving me the error: An exception of type 'System.NullReferenceException' occurred in mscorlib.dll but was not handled in user code Additional information: Object

Can await and then be mixed in one implementation?

 ̄綄美尐妖づ 提交于 2019-12-24 06:35:43
问题 I'm wondering if await and .then can be used in the same async function? Here is my function: uploadImageToImgur: async function (file) { return new Promise(function(resolve, reject) { const url = 'https://api.imgur.com/3/image', reader = new FileReader(); if (file) { reader.readAsDataURL(file); } reader.onloadend = async function () { let { result } = reader; try { const request = await fetch(url, { method: 'POST', headers: { "Authorization": 'my auth', }, body: result.replace(/^data:image\/

Task - Property Assignment

匆匆过客 提交于 2019-12-24 06:27:21
问题 Originally, I had the following: foreach (Product product in products) { product.ImageUri = _imageClient.GetImageUri(product.GetImagePath()); } What I would like to do is process all of the Products in parallel rather than one at a time. I have updated _imageClient.GetImageUri(...) to _imageClient.GetImageUriAsync(...). I can now do the following: List<Task<Uri>> tasks = new List<Task<Uri>>(); foreach (Product product in products) { Task<Uri> task = _imageClient.GetImageUriAsync(product

Azure .NET Core Appservice locks up sending 502.3 because of async calls

牧云@^-^@ 提交于 2019-12-24 06:14:20
问题 I have this method running in a .NET Core 2.X app running in Azure app service. I have a remote server that we use this method to call from button presses in our Angular website. that calls a remote device. Angular button --> .NET Core app service in Azure --> another app service --> internet\cell connected device. We wait for the response from the device to return a status code. If I quickly send commands [2 or 3 in a second] to this method it causes the app service to stop responding until

Azure .NET Core Appservice locks up sending 502.3 because of async calls

喜你入骨 提交于 2019-12-24 06:14:07
问题 I have this method running in a .NET Core 2.X app running in Azure app service. I have a remote server that we use this method to call from button presses in our Angular website. that calls a remote device. Angular button --> .NET Core app service in Azure --> another app service --> internet\cell connected device. We wait for the response from the device to return a status code. If I quickly send commands [2 or 3 in a second] to this method it causes the app service to stop responding until

On Android device UI update happens only after user interaction

做~自己de王妃 提交于 2019-12-24 06:08:08
问题 Interesting (at least for me) bug I found there. I am making an (prototype) app, it does some web requests and returns simple data. There is ObservableCollection<DownloadbleEntity> which is updated dynamicly (because DownloadbleEntity contains the image which we get by other requests, to output list element with an image). Here is layout part: <MvvmCross.Binding.Droid.Views.MvxListView android:id="@+id/searchlist" android:layout_width="fill_parent" android:layout_height="fill_parent" android