Seems to be something very simple I'm missing, but can't find any example of how to handle such case. I need to construct a switch statement like this ...
Seems to be something very simple I'm missing, but can't find any example of how to handle such case. I need to construct a switch statement like this ...
I am working with .NET 6 and have a UI and API which is using the new DateOnly type. Following the answer from this article: System.NotSupportedExce ...
C#10 in .NET 6.0 supports a new feature called global using directive. It seems to do 2 things: When you have a namespace in the global using, yo ...
When I write this statement: var x = new ClassName(); x is implicitly typed as a ClassName?. That is, since ClassName is a reference type, implicit ...
So I'm working with code in which there are two object that contain each other, inside a list of which I do not know the contents of until runtime. I ...
C# 9 added the record type, which is a new reference type that uses value-based equality. C# 10 introduced the record struct syntax to define a value ...
I have a solution with three projects that is holding several API keys. These keys are for reasonably sensitive Web API's including OpenWeatherMap, Go ...
The C# compiler responds that, in the body of s<T>, I cannot convert from 'T' to 'int'. Is there another way to bridge the generic -> overl ...
C# 10 brought implicit usings. I globaly like them, but they're causing me a conflict on a particular class called Region as there's a conflict with ...
I am annoyed with the HttpContext class that uses different types for the request and response than HttpRequestMessage and HttpResponseMessage. The Ht ...
Using C# 10 I have the interface: public interface IPluralRuleProvider { Boolean TryGetRule(CultureInfo culture, out PluralizationRuleDelegate ru ...
Will my Windows Forms app (.NET Framework) and Win Forms app (.NET Core) that both written on C# on WindowsOS work on Mono installed on MacOS? My purp ...
I have two class definition that are actually the same. What i'm trying to do is make the T attribute Nullable is there any way to simplify? is for ...
I am having the following error when trying to create a windows service: Description: The process was terminated due to an unhandled exception. Ex ...
I'm trying to write the following code: var name = "Kyle"; var sayHello = () => $"Hello, {name}"; Console.WriteLine(sayHello()); But I get the e ...
Trying to compile simple C# code at runtime on .NET Core but have this error: System.PlatformNotSupportedException: 'Operation is not supported on ...
Is it possible to increase a value in the appsettings.json when I publish a project? I want to add some kind of number to all css and js files, becau ...
I'm making console application in C# 10 .NET 6 using the Dependency Injection. I have an appsettings.json file that i load by IConfiguration but i hav ...
I'm currently writing a project in C# 7.3 but I need to change it to C# 10.0 When I go to my project's properties' advanced build settings, the optio ...
Today I was copying some methods from an abstract class to an Interface and I realized that the compiler does not underline the abstract keyword. I tr ...