Is it possible to await an event instead of another async method?

In my C#/XAML metro app, there’s a button which kicks off a long-running process. So, as recommended, I’m using async/await to make sure the UI thread doesn’t get blocked: private async void Button_Click_1(object sender, RoutedEventArgs e) { await GetResults(); } private async Task GetResults() { // Do lot of complex stuff that takes a long … Read more

“Permission Denied” trying to run Python on Windows 10

Seems as though an update on Windows 10 overnight broke Python. Just trying to run python –version returned a “Permission Denied” error. None of the three updates; KB4507453, KB4506991, or KB4509096 look like they’d be the culprit but the timing of the issue is suspicious. Rather than messing with rolling back, I’m hoping there’s a … Read more

Getting content/message from HttpResponseMessage

I’m trying to get content of HttpResponseMessage. It should be: {“message”:”Action ” does not exist!”,”success”:false}, but I don’t know, how to get it out of HttpResponseMessage. HttpClient httpClient = new HttpClient(); HttpResponseMessage response = await httpClient.GetAsync(“http://****?action=”); txtBlock.Text = Convert.ToString(response); //wrong! In this case txtBlock would have value: StatusCode: 200, ReasonPhrase: ‘OK’, Version: 1.1, Content: System.Net.Http.StreamContent, … Read more

Adding headers when using httpClient.GetAsync

I’m implementing an API made by other colleagues with Apiary.io, in a Windows Store app project. They show this example of a method I have to implement: var baseAddress = new Uri(“https://private-a8014-xxxxxx.apiary-mock.com/”); using (var httpClient = new HttpClient{ BaseAddress = baseAddress }) { using (var response = await httpClient.GetAsync(“user/list{?organizationId}”)) { string responseData = await response.Content.ReadAsStringAsync(); … Read more

Where do I mark a lambda expression async?

I’ve got this code: private async void ContextMenuForGroupRightTapped(object sender, RightTappedRoutedEventArgs args) { CheckBox ckbx = null; if (sender is CheckBox) { ckbx = sender as CheckBox; } if (null == ckbx) { return; } string groupName = ckbx.Content.ToString(); var contextMenu = new PopupMenu(); // Add a command to edit the current Group contextMenu.Commands.Add(new UICommand(“Edit this … Read more

Signtool error: No certificates were found that met all given criteria with a Windows Store App?

I’m trying to sign a Windows 8 appx package with a pfx file I have. I’m using a command like so: signtool.exe sign /fd sha256 /f “key.pfx” “app.appx” And from this, I get: SignTool Error: No certificates were found that met all the given criteria. What “criteria” am I not meeting? This is only for … Read more

How does Windows 8 Runtime (WinRT / Windows Store apps / Windows 10 Universal App) compare to Silverlight and WPF? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

Synchronously waiting for an async operation, and why does Wait() freeze the program here

Preface: I’m looking for an explanation, not just a solution. I already know the solution. Despite having spent several days studying MSDN articles about the Task-based Asynchronous Pattern (TAP), async and await, I’m still a bit confused about some of the finer details. I’m writing a logger for Windows Store Apps, and I want to … Read more