.net-core

Web App on Azure loaded slow after applying custom domain

折月煮酒 提交于 2021-01-27 07:24:32
问题 I just started hosting my website on Azure. Initially when uploading and hosting the website on xxxx.azurewebsites.net, the performance and response was great. After adding a custom domain (Bought from Godaddy), the performance became worst and it would take 1 min for a page to load. xxxx.azurewebsites.net -> loaded in few seconds xxxx.com -> loaded in almost a minute Is there anything im missing here? In General Configuration, I have enabled Always On but the performance is still the same

How to force System.Text.Json serializer throw exception when property is missing?

瘦欲@ 提交于 2021-01-27 07:16:57
问题 Json.NET behaviour could be defined by attributes: either use default or just throw an exception if json payload does not contain required property. Yet System.Text.Json serializer silently does nothing. Having class: public sealed class Foo { [Required] public int Prop {get;set;} = 10; } and deserializing empty object: JsonSerializer.Deserialize<Foo>("{}"); I simply get an instance of Foo with Prop=10 . I could not find any setting in JsonSerializerOptions to force it throw an exception. Is

Why not inject IServiceProvider instead of each individual dependency?

流过昼夜 提交于 2021-01-27 07:06:02
问题 I am wondering why one wouldn't explicitly use the IServiceProvider to resolve dependencies over injecting each dependency individually. In other words, why use this approach: public class A { private B _b; private C _c; private D _d; private E _e; public A(B b, C c, D d, E e) { _b = b; _c = c; _d = d; _e = e; } } and not this: public class A { private B _b; private C _c; private D _d; private E _e; public A(IServiceProvider sp) { _b = (b) sp.GetService(typeof(b)); _c = (c) sp.GetService

What's the difference between IHostedService and Task for scheduled task in asp.net core?

狂风中的少年 提交于 2021-01-27 07:05:50
问题 I wanna update data from an in-memory database to a relational database every 5 minutes. Everyone suggests me to use the IHostedService from origin .net core or some other third-party package such as Hangfire . Whereas, I think it is so troublesome for it must code much. I have a strange idea that achieves it by the looping task, for example: using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc;

What's the difference between IHostedService and Task for scheduled task in asp.net core?

微笑、不失礼 提交于 2021-01-27 07:01:20
问题 I wanna update data from an in-memory database to a relational database every 5 minutes. Everyone suggests me to use the IHostedService from origin .net core or some other third-party package such as Hangfire . Whereas, I think it is so troublesome for it must code much. I have a strange idea that achieves it by the looping task, for example: using System; using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc;

Why not inject IServiceProvider instead of each individual dependency?

只谈情不闲聊 提交于 2021-01-27 06:54:47
问题 I am wondering why one wouldn't explicitly use the IServiceProvider to resolve dependencies over injecting each dependency individually. In other words, why use this approach: public class A { private B _b; private C _c; private D _d; private E _e; public A(B b, C c, D d, E e) { _b = b; _c = c; _d = d; _e = e; } } and not this: public class A { private B _b; private C _c; private D _d; private E _e; public A(IServiceProvider sp) { _b = (b) sp.GetService(typeof(b)); _c = (c) sp.GetService

.NET Core Selenium WebDriver not found

醉酒当歌 提交于 2021-01-27 06:40:20
问题 I've converted an NUnit test project from .NET Framework to .NET Core. When I try to execute a Selenium test using Visual Studio, I am seeing this error: OpenQA.Selenium.DriverServiceNotFoundException : The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html. I've included the Selenium.WebDriver.ChromeDriver Nuget Package and chromedriver.exe

.NET Core Selenium WebDriver not found

南笙酒味 提交于 2021-01-27 06:40:08
问题 I've converted an NUnit test project from .NET Framework to .NET Core. When I try to execute a Selenium test using Visual Studio, I am seeing this error: OpenQA.Selenium.DriverServiceNotFoundException : The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable. The driver can be downloaded at http://chromedriver.storage.googleapis.com/index.html. I've included the Selenium.WebDriver.ChromeDriver Nuget Package and chromedriver.exe

It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found

筅森魡賤 提交于 2021-01-27 05:54:02
问题 I had a .Net Core console app built and deployed. The project's Platform target is x86. Target framework is .Net Core 2.2(x86). Although .Net Core 2.2 (x86) SDK is installed, I get following error after executing the command dotnet myapp.dll in Developer Command Prompt VS2017. It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found. - The following versions are installed: 2.0.7 at [C:\Program Files\dotnet

It was not possible to find any compatible framework version. The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found

ε祈祈猫儿з 提交于 2021-01-27 05:52:34
问题 I had a .Net Core console app built and deployed. The project's Platform target is x86. Target framework is .Net Core 2.2(x86). Although .Net Core 2.2 (x86) SDK is installed, I get following error after executing the command dotnet myapp.dll in Developer Command Prompt VS2017. It was not possible to find any compatible framework version The specified framework 'Microsoft.NETCore.App', version '2.2.0' was not found. - The following versions are installed: 2.0.7 at [C:\Program Files\dotnet