How to use the Either type in C#?
[Zoran Horvat](https://www.pluralsight.com/authors/zoran-horvat) proposed the usage of the `Either` type to avoid null checks and during the execution of an operation. `Either` is common in functiona...
- Modified
- 3 Aug at 16:35
Why are Func<> delegates so much slower
I was in the process of moving repeated arithmetic code into reusable chunks using funcs but when I ran a simple test to benchmark if it will be any slower, I was surprised that it is twice as slow. ...
- Modified
- 7 May at 03:48
Unexpected results after optimizing switch case in Visual Studio with C#8.0
Today while coding, visual studio notified me that my switch case could be optimized. But the code that I had vs the code that visual studio generated from my switch case does not result in the same o...
SSL Error "The message received was unexpected or badly formatted" for a .NET application on one specific machine only
I have a .NET Core 3.1 C# application which is calling an API via HTTPS (and presenting its public key as part of getting the token as that certificate is later used to decrypt information sent back s...
Fetch access token from authorization header without bearer prefix
I'm using the and packages for my .NET Core project. There are some controller endpoints protected by the `[Authorize]` annotation that have to fetch the access token from the request. Currently I'm...
NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
I use .NET Core 5.0.100-preview.7.20366.6 , Blazor webassembly, Microsoft Visual Studio Community 2019 Preview Version 16.7.0 Preview 6.0 [](https://i.stack.imgur.com/OaHdj.png) file `foo.csproj` ``` ...
- Modified
- 1 Aug at 05:42
MediatR publish and MediatR send
I have tried the CQRS pattern using MediatR and am loving the clean state in which applications am working on are transforming. In all the examples i have seen and used, I always do ``` await Mediator...
- Modified
- 31 Jul at 06:12
Using async-await for database queries
I'm currently working on an ASP NET web api project, which has all its calls to the database in an asynchronous way. We are using [ServiceStack.OrmLite](https://github.com/ServiceStack/ServiceStack.Or...
- Modified
- 30 Jul at 03:17
Swagger is not Working Asp.net Core how to open swagger ui
This is my `Startup.cs` file This is my `ConfigureService` method in Startup.cs. I have modified it exactly according to documentation, but it's not working. I have removed the launch Url, so it's jus...
- Modified
- 1 Nov at 17:14
System.AggregateException: 'Some services are not able to be constructed' In my ASP.net core
I have a model: ``` public class Checkout { public string CheckoutId { get; set; } public List<CheckoutItem> CheckoutItems { get; set; } } ``` And I am trying to add methods to the Object w...
- Modified
- 29 Jul at 16:48
Maven is not using Java 11: error message "Fatal error compiling: invalid target release: 11"
I am trying to compile my project with Java 11. When I try to run the application with Java 8 as the Java version in , it works fine. But when I try to run it with Java 11, it throws an error. > Fatal...
- Modified
- 20 Aug at 21:14
ServiceStack ProtoBuf Error: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host
I have a ServiceStack service on a server and I am trying to run a program that connects to that service. I am getting the intermittent error below. This is the stack trace and anything that was bel...
- Modified
- 28 Jul at 11:56
Attempted import error: 'Switch' is not exported from 'react-router-dom'
I don't know why I am getting this error and I can't find an answer for it anywhere. I have uninstalled the `react-router-dom` package and reinstalled it, but it continues to tell me that the switch m...
- Modified
- 3 Feb at 22:12
dynamic c# ValueKind = Object
As i'm trying to access using using debugger. [](https://i.stack.imgur.com/NaMXf.png) Here is my result which i'm having below. ``` OtpData = ValueKind = Object : "{ "OTP":"3245234", ...
- Modified
- 27 Jul at 19:42
Why my coreWebView2 which is object of webView2 is null?
I am creating a object of Microsoft.Web.WebView2.WinForm.WebView2 but the sub obect of this coreWebView2 is null ``` Microsoft.Web.WebView2.WinForm.WebView2 webView = new Microsoft.Web.WebView2.WinFor...
- Modified
- 27 Jul at 13:46
SSL_ERROR_UNSUPPORTED_VERSION when attempting to debug with IIS Express
Created a new template ASP.Net Core 3.1 MVC web app. When I attempt to debug it using IIS Express I get the following error in firefox: > Secure Connection FailedAn error occurred during a connection ...
- Modified
- 24 Sep at 09:45
c# 9.0 records - reflection and generic constraints
Two questions regarding the new records feature : 1. How do I recognize a record using reflection ? looking [here][1] maybe there is a way to detect the EqualityContract but I am not sure if that is ...
- Modified
- 23 Nov at 01:45
Visual Studio Code C# Debugging Problem (The terminal process failed to launch: Path to shell executable "dotnet" is not a file of a symlink.)
I created a workspace using `dotnet new console`, wrote some code. But when I try to start debugging it using the option Run/Start debugging in visual studio code, it fails with the message: > Executi...
- Modified
- 25 Jul at 19:57
How to convert camel case to snake case with two capitals next to each other
I am trying to convert camel case to snake case. Like this: `"LiveKarma"` -> `"live_karma"` `"youGO"` -> `"you_g_o"` I cannot seem to get the second example working like that. It always outputs as 'yo...
How to create an SDK-style .NET Framework project in VS?
Is it possible to create an `SDK-style` `.NET Framework` project in Visual Studio (to be more specific I use the latest VS2019)? Or does it still require manual manipulations? ``` <Project Sdk="Micros...
- Modified
- 9 Jun at 21:50
Blazor WebAssembly Environment Variables
I'm currently working on a .NET Standard 2.1 Blazor WebAssembly application. I try to include or exclude Stylesheets according to an environment variable. In .NET Core there are usually Environment Ta...
- Modified
- 23 Jul at 13:31
ServiceStack Nuxt.js SPA and ImageSharp.Web integration
I am migrating my project from Asp.Net MVC to ServiceStack Nuxt.js SPA and one thing that I used on MVC was ImageProcessor.Web to manipulate images on the fly I am now trying to use ImageSharp.Web wit...
- Modified
- 23 Jul at 07:46
ServiceStack AutoQuery get random rows
I am migrating from EF6 and trying ServiceStack AutoQuery and I came to a bump - cant find a way to get random rows from database. Also is there a way to create computed columns directly in ORMLite PO...
- Modified
- 22 Jul at 17:37
Azure Functions: Queue Trigger is expecting Base-64 messages and doesn't process them correctly
I have this `Queue Trigger`. The expected is when I insert a message in the `Queue`, the trigger must fire and process the dequeued message. ``` [FunctionName("NewPayrollQueueTrigger")] public asy...
- Modified
- 22 Jul at 14:20
FluentValidation: How to register all validators automatically from another assembly?
I'm using "FluentValidation.AspNetCore" library (Version="8.6.2") for a .Net Core project. What I would like to do is to register all my Validators automatically in Startup.cs class, using somethin...
- Modified
- 2 May at 11:0