How can I implement ISerializable in .NET 4+ without violating inheritance security rules?
Background: [Noda Time](https://nodatime.org) contains many serializable structs. While I dislike binary serialization, we received many requests to support it, back in the 1.x timeline. We support it...
- Modified
- 10 Aug at 12:26
How to (should I) mock DocumentClient for DocumentDb unit testing?
From the new CosmosDb emulator I got sort of a repository to perform basic documentdb operations, this repository gets injected to other classes. I wanted to unit test a basic query. ``` public clas...
- Modified
- 24 Jan at 18:27
Efficiency of very large collections; iteration and sort
I have a csv parser that reads in 15+ million rows (with many duplicates), and once parsed into structs, need to be added to a collection. Each struct has properties Key (int), A(datetime), and B(int...
batch file from scheduled task returns code 2147942401
I am trying to schedule a job to run a batch file with Windows 10 Task Scheduler, but it results in return code 2147942401. The batch file is on remote location so I am giving the absolute path "\\se...
- Modified
- 23 Jan at 11:5
Why does pattern matching on a nullable result in syntax errors?
I like to use `pattern-matching` on a `nullable int` i.e. `int?`: ``` int t = 42; object tobj = t; if (tobj is int? i) { System.Console.WriteLine($"It is a nullable int of value {i}"); } ```...
- Modified
- 11 Apr at 16:11
Async programming and Azure functions
In the Azure functions "Performance considerations" part, [Functions Best Practices](https://learn.microsoft.com/en-us/azure/azure-functions/functions-best-practices), under "Use async code but avoid ...
- Modified
- 8 Apr at 22:24
Return "raw" json in ASP.NET Core 2.0 Web Api
The standard way AFAIK to return data in ASP.NET Core Web Api is by using `IActionResult` and providing e.g. an `OkObject` result. This works fine with objects, but what if I have obtained a JSON stri...
- Modified
- 19 Jan at 08:12
The listener for function was unable to start. Why?
I'm getting the following error when I run the azure function from visual studio. > A ScriptHost error has occurred [1/19/2018 6:40:52 AM] The listener for function 'MyFunctionName' was unable to s...
- Modified
- 22 Mar at 11:24
Send messages to Whatsapp number using PHP
I have to send messages to the customer's programatically. What are the pre requirements/needs? Do I need to convert/register my personal number to business account? Is there any provided by fo...
Unable to open the NuGet Package Manager Console
When I try to open the I get the following error. Am not sure what is preventing the Package Manager Console to open. ``` Each package is licensed to you by its owner. NuGet is not responsible for, ...
- Modified
- 6 Aug at 14:43
Error: "is not recognized as an internal or external command, operable program or batch file"
Whenever I try and run `mycommand.exe` from my Windows `cmd.exe` terminal, I get this error: > ''mycommand.exe' is not recognized as an internal or external command, operable program or batch file' I...
- Modified
- 13 Dec at 11:15
Short running background task in .NET Core
I just discovered `IHostedService` and .NET Core 2.1 `BackgroundService` class. I think idea is awesome. [Documentation](https://learn.microsoft.com/en-us/dotnet/standard/microservices-architecture/mu...
- Modified
- 18 Jan at 12:25
.NET: file uploading to server using http
I have a running-state `.php` script that hits a URL and uploads a single/multiple files `.csv` type with a unique `token` sent with them (in the body AFAIK). Below is the working snippet: ``` <?ph...
- Modified
- 28 Jan at 20:56
Changing font family of all MUI components
Can we change the font family of MUI components with less code. I have tried many ways but still, I can't able to do it. I have to change the font family individually which is really a lot of work. Ar...
- Modified
- 10 Nov at 05:24
ORMLite/Servicestack: Joining Multiple Nested Tables Together
I think this should be easy, and I'm not sure if I'm just missing something or if this feature is missing from ServiceStack/ORMLite currently. I've got a tablestructure that looks something like this:...
- Modified
- 5 May at 22:28
C# 7 ref return for reference types
I'm going through some code that uses the new features of C# 7 and uses the ref locals & returns feature. It seems pretty straight forward for `value-types` where the ref local variable gets a refere...
- Modified
- 5 Feb at 07:51
What is the best way to get the list of column names using CsvHelper?
I am trying to use CsvHelper for a project. I went through the documentation but I couldn't find a way to read all the column names with a single method. How can I get a list of all column header name...
Is there an equivalent of C#'s nameof(..) in F#?
I have the following lines of code I want to port from C# to F#: ``` private const string TypeName = nameof(MyClass); private const string MemberName = nameof(MyClass.MyMember); ``` The value of `T...
React Native: JAVA_HOME is not set and no 'java' command could be found in your PATH
I've followed step by step the official [Getting Started](https://facebook.github.io/react-native/docs/getting-started.html). I started from a clean linux install and installed everything required as ...
- Modified
- 17 Jan at 10:31
npm install ->Failed at the node-sass@4.5.0 postinstall script
I'm trying to do `npm install` and an error appears : ``` Failed at the node-sass@4.5.0 postinstall script. ``` I tried to delete `node_modules` and then reinstall it, same error appears. what wil...
Changing directory in Google colab (breaking out of the python interpreter)
So I'm trying to git clone and cd into that directory using Google collab - but I cant cd into it. What am I doing wrong? > !rm -rf SwitchFrequencyAnalysis && git clone [https://github.com/ACECentre/...
- Modified
- 20 Jun at 09:12
MarkupExtensions, Constructor and Intellisense
I am trying to create my own MarkupExtension for localization. The idea is to pass a name of a resource (for example 'Save') to the markup extension and the return would be localized value (for exampl...
- Modified
- 17 Jan at 08:19
Login with ASP Identity fails every time with "Not Allowed" (even when 'email' and 'username' have the same value))
Registering a user works fine, as it logs in via this line: ``` await _signInManager.SignInAsync(user, isPersistent: model.RememberMe); ``` But if I want to log in with the same user again does not...
- Modified
- 16 Jan at 22:38
How to create a mock instance of IOptions<MyOption>?
I'm using `IOptions<>` according to [https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/options)...
- Modified
- 16 Jan at 18:31
Can one reduce the number of type parameters?
I find it annoying that one has to specify the types of both Foo and FooFactory in the call to RunTest below. After all, if the test knows the type of the Factory, the type the Factory is creating is ...
- Modified
- 16 Jan at 18:15