C# Unable to cast object of type 'System.Double' to type 'System.Single'

before judging that this question is already answered, please read the description. I have this simple code below: ``` Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("key" , 3...

When uploading file chunks are they guaranteed to be received in the same order?

Javascript front end, servicestack back end. I'm using the latest version of dropzone.js to upload large image files (up to 50GB). The file is broken into many chunks and the server receives them one...

18 Jul at 23:23

Service Stack - Trying to create a POST function and read the JSON data

I'm just trying to create a simple POST function that let's me POST a JSON. I've tried to copy examples but I'm not sure what I'm doing differently. Any help would be appreciated, I feel like it's s...

18 Jul at 18:0

How can I throw Exception for async function using Moq

I am writing test cases using xUnit and Moq. I am using below code in Test class for testing `catch()` of another class method ``` private readonly IADLS_Operations _iADLS_Operations; [Fact] publi...

18 Jul at 15:8

Unable to Mock HttpClient PostAsync() in unit tests

I am writing test cases using xUnit and Moq. I am trying to mock PostAsync() of HttpClient, but I get an error. Below is the code used for mocking: ``` public TestADLS_Operations() { va...

14 Jan at 18:40

DynamicData - Unable to move the static method to another class (Even Base class)

I'm developing a Dynamic Data Test (c#) as described in [https://www.meziantou.net/mstest-v2-data-tests.htm#using-dynamicdata](https://www.meziantou.net/mstest-v2-data-tests.htm#using-dynamicdata). B...

17 Jul at 12:15

Command dotnet ef not found

I'm following [the docs](https://learn.microsoft.com/en-us/aspnet/core/data/ef-mvc/migrations?view=aspnetcore-3.0#create-an-initial-migration) in order to create an initial migration. When I execute `...

How do I create .NET framework 4.6 version of XUnit project in Visual Studio 2019?

I notice when I start up Visual Studio 2019, I am unable to create a .NET Framework version of XUnit or NUnit (only MSTests). We have been mandated to use XUnit tests, but our solution is all .NET Fra...

Blueimp's jquery fileupload of large files fails when chuncked

Using the latest version of blueimp's jquery fileupload in a durandal web app. I've used an older version (4.x) in another asp.net project and it works well there. The backend is servicestack. I can ...

What is the purpose of JwtBearerOptions.SaveToken property in ASP.NET Core 2.0+?

The [Microsoft Docs](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbeareroptions.savetoken?view=aspnetcore-2.2#Microsoft_AspNetCore_Authentication_JwtBe...

16 Jul at 12:53

Checking Concurrency on an Entity without updating the Row Version

I have a that I need to do a (as annotated as below) ``` [Timestamp] public byte[] RowVersion { get; set; } ``` I have a bunch of that access values out of this and primarily its . 1. Cl...

Pass Parameters to AddHostedService

I am writing a .Net Core windows service and here is a snippet of code: ``` internal static class Program { public static async Task Main(string[] args) { var isService...

Swagger 'swagger.json' loads, but 404 error on swagger UI '{localhost}/swagger' in AspNet project

Working on setting up swagger for a web application hosted with IIS using AspNetCore. The .json page loads and seems to be touching all the API just fine, however when navigating to {localhost}/swagge...

Why FileSystemWatcher doesn't work in Linux container watching Windows volume

Given the program: ``` using System; using System.IO; namespace fsw_bug_poc { class Program { private static FileSystemWatcher _fileSystemWatcher; static void Main(string[] ...

How can I get the current route name with ASP.NET Core?

I have an application that is written on the top of ASP.NET Core 2.2 framework. I have the following controller ``` public class TestController : Controller { [Route("some-parameter-3/{name}/{id...

Read SSL via PipeReader in .NET

Currently I have a working implementation by using an SSL Stream, wrapped in a bufferedstream, and just calling read/write on the stream using byte arrays. I want to make this faster, and from some r...

25 Jul at 21:47

InvalidOperationException: Key type not specified. Microsoft.AspNetCore.ApiAuthorization.IdentityServer.ConfigureSigningCredentials.LoadKey()

Attempting to publish a basic .NET Core React app with auth functionality I am receiving an error with IdentityServer. This is using dotnet new react --auth Individual, .Net Core 3.0 Preview5, and f...

18 Jul at 19:40

How to get OAuth2 access token for EWS managed API in service/daemon application

# Scenario I have an Exchange Online environment and service/daemin (no interactive user) application on the Azure VM. Service uses EWS managed API to work with emails in the mailbox of tenant us...

Performance using Span<T> to parse a text file

I am trying to take advantage of `Span<T>`, using to improve the performance of parsing text from a text file. The text file contains multiple consecutive rows of data which will each be split into f...

12 Jul at 15:56

When is it necessary to enable SSL on MailKit

I read on the Microsoft website that the SmtpClient was obsolete and they recommended using the MailKit for it's replacement. I'm in the process of writing an application to make use of the MailKit. T...

7 Aug at 15:0

How to set dependencies when I use .NET Standard 2.0 DLL libraries with a .NET Framework console application?

I can't figure out how should I set up dependencies (where to add EntityFramework nuget packages) in this scenario: 1. Core.Persistence project which compiles to .NET Standard 2.0 DLL library. I hav...

Why MouseMove event occurs after MouseUp event?

In `WindowsForms` I just added event handlers as follows: ``` private void Form1_MouseDown(object sender, MouseEventArgs e) { Debug.WriteLine($"=> Form1_MouseDown, Clicks: {e.Clicks}, Loc...

14 Jul at 06:17

decimal.ToString("C") produces ¤ currency symbol on Linux

I have an ASP.NET Core 2.1 project where I am rendering some currency numbers through a Razor HTML page. ``` class MyModel { public decimal Money { get; set; } = 1.23 } ``` ``` @model MyMod...

11 Jul at 16:32

ServiceStack's RedisTypedClient - Can you use strings to define the type?

I'm trying to figure out if there is any way to create a `RedisClient` that has the functionality of a `RedisTypedClient` but able to define the URN key with a simple string instead of passing in a ty...

"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 KB45090...