Found conflicts between different versions of "System.Runtime.CompilerServices.Unsafe" that could not be resolved

This may seem as one of many similar questions, but I could not find the solution in other questions. I will jump straight to the binary log: [](https://i.stack.imgur.com/5BNlX.png) And here is the re...

31 Oct at 01:41

C# 9 top-level programs without csproj?

One feature of coming C# 9 is so called top-level programs. So that you could just write the following without classes. ``` using System; Console.WriteLine("Hello World!"); ``` and `dotnet run` will...

21 Oct at 12:14

C# Create lambda over given method that injects first paramater

In C# I have following methods defined in given class (non static): ``` int MyMethod(ScriptEngine script, int a, int b) { return a + b; } void MyMethod2(ScriptEngine script, string c) { // do...

16 Oct at 08:27

Redis subscriptions realiblity and retry

Im using [ServiceStack.Redis](https://github.com/ServiceStack/ServiceStack.Redis) in my application and i have my subscribe method is this: ``` protected void Subscribe(string channelsToSubscribe) ...

14 Oct at 19:11

ERROR: JAVA_HOME is not set and no 'java' command could be found in your flutter PATH. In Flutter

I installed Android Studio 4.1 and tried to run the existing project. But it gives an error like this: ``` ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set th...

20 Mar at 16:34

ServiceStack IoC/DI: Registering classes in the Container - how to register all that implements a specific interface

I have started looking into ServiceStack IoC/DI more closely, and it is working very nicely so far, when I for example use the manual registration approach: ``` container.AddScoped<IGeoService, GeoSer...

14 Oct at 15:12

What is the difference between discard and not assigning a variable?

In c# 7.0, you can use discards. What is the difference between using a discard and simply not assigning a variable? ``` public List<string> DoSomething(List<string> aList) { //does something and ret...

14 Oct at 09:51

Custom Equality check for C# 9 records

From what I understand, records are actually classes that implement their own equality check in a way that your object is value-driven and not reference driven. In short, for the `record Foo` that is ...

14 Mar at 20:33

Unity "Multiple precompiled assemblies with the same name" using external dll

I have a "Shared" project where I share code between my client (unity) and my server (C# server) Both projects require Newtonsoft.Json.dll --- When I compile the Shared.dll and put it inside of Uni...

12 Oct at 15:46

Unexpected behavior of a C# 8.0 default interface member

Consider the following code: ``` interface I { string M1() => "I.M1"; string M2() => "I.M2"; } abstract class A : I {} class C : A { public string M1() => "C.M1"; public virtual stri...

Typed HttpClient vs IHttpClientFactory

Is there any difference between the following 2 scenarios of setting up HttpClient? Should I prefer one to another? Typed client: ``` public class CatalogService { private readonly HttpClient _ht...

Why is this System.IO.Pipelines code much slower than Stream-based code?

I've written a little parsing program to compare the older `System.IO.Stream` and the newer `System.IO.Pipelines` in .NET Core. I'm expecting the pipelines code to be of equivalent speed or faster. Ho...

Null check operator used on a null value

I am new to `Flutter` I got this error when I run my simple flutter APP. I could not figure out why this error occurred. `Null check operator used on a null value` My code in main.dart ``` import 'pa...

16 Jun at 09:10

How to load a CSV file created from a dictionary with entities using ServiceStack.Text

I have a Dictionary that has key: a string, value: a List of Entity, where Entity is a class: ``` public class Entity { public string myString { get; set; } public int myInt { get; set; } } D...

9 Oct at 06:12

How to solve "error: Microsoft Visual C++ 14.0 or greater is required" when installing Python packages?

I'm trying to install a package on Python, but Python is throwing an error on installing packages. I'm getting an error every time I tried to install `pip install google-search-api`. Here is the error...

19 Mar at 10:42

Why would one need this lambda: Function(x) x

I found this line in an old branch and, as I have a lot of respect for the (unreachable) author, I'm trying to make sense of one specific line, more precisely the lambda at the end: ``` container.Regi...

7 Oct at 20:47

Customizing .csproj in Unity enable nullable reference types

Unity3D's 2020.2 release is now supporting C# 8 and nullable reference types. The default way to opt in to this language feature is to put `<Nullable>enable</Nullable>` in your `.csproj` file, but Uni...

6 Oct at 15:57

An error, "failed to solve with frontend dockerfile.v0"

I was trying to build my Docker image for my [Gatsby](https://www.gatsbyjs.com/) application. Whenever I run the command `docker build . -t gatsbyapp`, it gives me an error: ``` failed to solve with f...

IDW10201: Neither scope or roles claim was found in the bearer token

I have a ASP.NET Core 3.1 project like this sample: [Sign-in a user with the Microsoft Identity Platform in a WPF Desktop application and call an ASP.NET Core Web API](https://github.com/Azure-Samples...

How to replace Microsoft.WindowsAzure.Storage with Microsoft.Azure.Storage.Blob

In my asp.net mvc application I am using Microsoft.WindowsAzure.Storage 8.0.1 for uploading/downloading blob to/from an azure cloud container. Now NuGet Package Manager informed me that Microsoft.Wind...

C#: how to detect repeating values in an array and process them in such a way that each repeating value is only processed once?

I wrote this simple program: ``` class Program { static void Main(string[] args) { Console.Write("Number of elements in the array: "); int numberOfElements ...

2 Oct at 21:38

C# calculations differ between const and variable locals?

I was setting up a pop quiz for my colleagues about the Banker's Rounding approach that C# uses in the `Math.Round` function. But while preparing the question in repl.it I got a result that I thought ...

27 Oct at 10:12

How to work around Unity not displaying interfaces in the Inspector?

If have an `interface`, say... and I have a `MonoBehaviour` class that implements the interface, say... and I want to reference the interface in another `MonoBehaviour` class, say... then I find that ...

11 Sep at 11:18

Cancellation Token Injection

I'd like to be able to pass cancellation tokens via dependency injection instead of as parameters every time. Is this a thing? We have an asp.net-core 2.1 app, where we pass calls from controllers int...

Use IWebHostEnvironment in Program.cs web host builder in ASP.NET Core 3.1

I have an ASP.NET Core 3.1 application, and I need to access the `IWebHostEnvironment` in the `Program.cs` web host builder. This is what I have right now (`Program.cs`): ``` public class Program { ...

28 Sep at 13:4