.net-core-3.1

.net core 3.1: 'IAsyncEnumerable<string>' does not contain a definition for 'GetAwaiter'

自作多情 提交于 2020-08-09 06:19:11
问题 I have a .net core 3.1 console app. I have a method with the following signature: public async IAsyncEnumerable<string> GetFilePathsFromRelativePathAsync(string relativePath) If I call it: private async Task<IEnumerable<FileUpload>> GetFileUploadsAsync(string relativePath) { ... var filePaths = await service.GetFilePathsFromRelativePathAsync(relativePath); ... } I get the following error: Error CS1061 'IAsyncEnumerable' does not contain a definition for 'GetAwaiter' and no accessible

Why File.ReadAllLinesAsync() blocks the UI thread? [closed]

。_饼干妹妹 提交于 2020-08-06 05:37:13
问题 Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 days ago . Improve this question Here is my code. An event handler for WPF button that reads lines of a file: private async void Button_OnClick(object sender, RoutedEventArgs e) { Button.Content = "Loading..."; var lines = await File.ReadAllLinesAsync(@"D:\temp.txt"); //Why blocking UI Thread??? Button.Content =

The difference between abstract classes and interfaces in C# 8 release? [closed]

℡╲_俬逩灬. 提交于 2020-07-31 03:27:36
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 months ago . Improve this question So in C# 8 interfaces will be able to have actual implementations of methods. At that point, what will be the difference between abstract classes and interfaces and why would I ever use abstract class anymore?What would be the advantage of this change

HttpContext is NULL when running web app in IIS

安稳与你 提交于 2020-07-28 20:30:13
问题 I have two application, both running on the same Windows machine. One application is IdentityServer4, and the other is my own web application (Server side Blazor app). Both web apps are build with .NET Core 3.1. When I navigate to my web app, I first get redirected to my IdentityServer4 app. I login, and after that I get redirected back to my web app. The login was successful, because there are no errors in the logs of IdentitServer. Also, I see a certain claim value on my Blazor webpage. I

HttpContext is NULL when running web app in IIS

自作多情 提交于 2020-07-28 20:25:22
问题 I have two application, both running on the same Windows machine. One application is IdentityServer4, and the other is my own web application (Server side Blazor app). Both web apps are build with .NET Core 3.1. When I navigate to my web app, I first get redirected to my IdentityServer4 app. I login, and after that I get redirected back to my web app. The login was successful, because there are no errors in the logs of IdentitServer. Also, I see a certain claim value on my Blazor webpage. I

HttpContext is NULL when running web app in IIS

大城市里の小女人 提交于 2020-07-28 20:23:09
问题 I have two application, both running on the same Windows machine. One application is IdentityServer4, and the other is my own web application (Server side Blazor app). Both web apps are build with .NET Core 3.1. When I navigate to my web app, I first get redirected to my IdentityServer4 app. I login, and after that I get redirected back to my web app. The login was successful, because there are no errors in the logs of IdentitServer. Also, I see a certain claim value on my Blazor webpage. I

System.Text.Json and Dynamically Parsing polymorphic objects

这一生的挚爱 提交于 2020-07-28 04:22:51
问题 I don't believe I am wrapping my head around how to properly use JsonConverter for polymorphism in parsing json results. In my scenario, I am targeting Git Policy Configurations in TFS. A policy configuration: "value": [ { "createdBy": { "displayName": "username", "url": "url", "id": "id", "uniqueName": "user", "imageUrl": "url" }, "createdDate": "2020-03-21T18:17:24.3240783Z", "isEnabled": true, "isBlocking": true, "isDeleted": false, "settings": { "minimumApproverCount": 1,

System.Text.Json and Dynamically Parsing polymorphic objects

佐手、 提交于 2020-07-28 04:21:04
问题 I don't believe I am wrapping my head around how to properly use JsonConverter for polymorphism in parsing json results. In my scenario, I am targeting Git Policy Configurations in TFS. A policy configuration: "value": [ { "createdBy": { "displayName": "username", "url": "url", "id": "id", "uniqueName": "user", "imageUrl": "url" }, "createdDate": "2020-03-21T18:17:24.3240783Z", "isEnabled": true, "isBlocking": true, "isDeleted": false, "settings": { "minimumApproverCount": 1,