.net-core-3.1

Catching Exceptions in async methods when not called with await

女生的网名这么多〃 提交于 2021-01-03 05:35:40
问题 Goal: I am confused by the behavior I am seeing with exceptions in my .Net Core library. The goal of this question is to understand why it is doing what I am seeing. Executive Summary I thought that when an async method is called, the code in it is executed synchronously until it hits the first await. If that is the case, then, if an exception is thrown during that "synchronous code", why is it not propagated up to the calling method? (As a normal synchronous method would do.) Example Code:

Catching Exceptions in async methods when not called with await

冷暖自知 提交于 2021-01-03 05:34:34
问题 Goal: I am confused by the behavior I am seeing with exceptions in my .Net Core library. The goal of this question is to understand why it is doing what I am seeing. Executive Summary I thought that when an async method is called, the code in it is executed synchronously until it hits the first await. If that is the case, then, if an exception is thrown during that "synchronous code", why is it not propagated up to the calling method? (As a normal synchronous method would do.) Example Code:

.NET Core 3.1 loading config from appsettings.json for console application

荒凉一梦 提交于 2021-01-02 06:15:42
问题 For .NET Core 3.1, console application how can I read a complex object from appsetting.json file and cast it into the corresponding object? All the examples I see online seem to be for previous versions of .NET core and things seems to have changed since then. Below is my sample code. I don't really know how to proceed from here. Thank you for your help. appsettings.json { "Player": { "Name": "Messi", "Age": "31", "Hobby": "Football" } } Player.cs class Player { public string Name { get; set;

.NET Core 3.1 loading config from appsettings.json for console application

淺唱寂寞╮ 提交于 2021-01-02 06:14:24
问题 For .NET Core 3.1, console application how can I read a complex object from appsetting.json file and cast it into the corresponding object? All the examples I see online seem to be for previous versions of .NET core and things seems to have changed since then. Below is my sample code. I don't really know how to proceed from here. Thank you for your help. appsettings.json { "Player": { "Name": "Messi", "Age": "31", "Hobby": "Football" } } Player.cs class Player { public string Name { get; set;

Published .Net Core App Warns to Install .Net Core but it's Already Installed

╄→尐↘猪︶ㄣ 提交于 2020-12-31 01:45:42
问题 I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant single-file apps. When the person opened the WPF app they were greeted with the standard warning: They clicked yes and to my understanding, they installed .Net Core 3.1 which is what the applications target. After they restarted the computer they got the exact same warning again. I wasn't sure what

Published .Net Core App Warns to Install .Net Core but it's Already Installed

喜你入骨 提交于 2020-12-31 01:40:47
问题 I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant single-file apps. When the person opened the WPF app they were greeted with the standard warning: They clicked yes and to my understanding, they installed .Net Core 3.1 which is what the applications target. After they restarted the computer they got the exact same warning again. I wasn't sure what

Published .Net Core App Warns to Install .Net Core but it's Already Installed

*爱你&永不变心* 提交于 2020-12-31 01:36:56
问题 I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant single-file apps. When the person opened the WPF app they were greeted with the standard warning: They clicked yes and to my understanding, they installed .Net Core 3.1 which is what the applications target. After they restarted the computer they got the exact same warning again. I wasn't sure what

Published .Net Core App Warns to Install .Net Core but it's Already Installed

℡╲_俬逩灬. 提交于 2020-12-31 01:36:18
问题 I made a WPF and Console application for someone to use on their private server which I can't have access to. I used Visual Studio 2019's built-in "Publishing Wizard" to create Framework Dependant single-file apps. When the person opened the WPF app they were greeted with the standard warning: They clicked yes and to my understanding, they installed .Net Core 3.1 which is what the applications target. After they restarted the computer they got the exact same warning again. I wasn't sure what

.NET Core 3.1 - Dependency resolution failed for component - AWS Mock Lambda Test Tools

◇◆丶佛笑我妖孽 提交于 2020-12-02 10:11:04
问题 I create a new AWS Lambda .NET Core 3.1 project, then run it using AWS Lambda Test Tools, then I get this page as expected: However, if I install one of these packages: Microsoft.EntityFrameworkCore.SqlServer Microsoft.Data.SqlClient When I run, I get this error and the test page won't open: AWS .NET Core 3.1 Mock Lambda Test Tool (0.10.0) Unknown error occurred causing process exit: Dependency resolution failed for component C:\Users\siri\repos\bolao-futebol\website-core\AWSLambda1\bin\Debug

.NET Core 3.1 - Dependency resolution failed for component - AWS Mock Lambda Test Tools

南楼画角 提交于 2020-12-02 10:09:32
问题 I create a new AWS Lambda .NET Core 3.1 project, then run it using AWS Lambda Test Tools, then I get this page as expected: However, if I install one of these packages: Microsoft.EntityFrameworkCore.SqlServer Microsoft.Data.SqlClient When I run, I get this error and the test page won't open: AWS .NET Core 3.1 Mock Lambda Test Tool (0.10.0) Unknown error occurred causing process exit: Dependency resolution failed for component C:\Users\siri\repos\bolao-futebol\website-core\AWSLambda1\bin\Debug