Blog
Page 13 of 20
2023-08-11 csharpdotnet
C# How to wait for a process to end?
You can use the WaitForExit method to wait for the process to complete. Your code will wait synchronously for the process to finish, then it will resume execution. Let’s look at an example: The code above will start a new cmd.exe process, and execute the timeout 5 command. The process.WaitForExit() call will force your program…
2023-08-08 informational
What does megabyte mean?
A megabyte (MB) equals one million bytes in the SI system, but can also mean 1,048,576 bytes in computing. Learn about the different definitions and conventions.
2023-08-07 informational
What comes after quadrillion?
After quadrillion comes quintillion, with 18 zeroes. Discover the full list of large number names from million all the way to centillion.
2023-08-06 csharp
C# 12 – Alias any type
The using alias directive has been relaxed in C# 12 to allow aliasing any sort of type, not just named types. This means that you can now alias tuples, pointers, array types, generic types, etc. So instead of using the full structural form of a tuple, you can now alias it with a short descriptive…
2023-08-06 dotnetdotnet-8
.NET 8 – JSON serialize property names using snake case and kebab case
Learn how to use the new snake_case and kebab-case JSON naming policies introduced in .NET 8 with System.Text.Json.
2023-08-05 csharp
Is there a C# With…End With statement equivalent?
The With…End With statement in VB allows you to execute a series of statements that repeatedly refer to a single object. Thus the statements can use a simplified syntax for accessing members of the object. For example: Is there a C# syntax equivalent? No. There is not. The closest thing to it would be the…
2023-07-30 csharp
C# 12 – Primary constructors
Starting from C# 12, it is possible to define a primary constructor within classes and structs. The parameters are placed in parentheses right after the type name. The parameters of a primary constructor have a broad scope. They can be utilized to initialize properties or fields, serve as variables in methods or local functions, and…
2023-06-14 dotnet
dotnet new api -aot: ‘-aot’ is not a valid option
Fix the '-aot is not a valid option' error by using the correct double-hyphen syntax: dotnet new api --aot.
2023-06-13 microsoft-graph
The type or namespace name ‘QueryOption’ could not be found
Starting with Microsoft Graph .NET SDK 5.0, the QueryOption class is no longer used. Instead, query options are set using the requestConfiguration modifier. Let’s take a simple example: If you must use QueryOptions, your only alternative is to downgrade the Microsoft Graph package to a 4.x version.
2023-06-12 dotnet-script
How to pass arguments to a dotnet script
Learn how to pass arguments to a dotnet script using the -- separator and access them via the Args collection.