Questions
C# questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Convert a C# Object to a JSON String in .NET
Learn how to serialize C# objects to JSON in .NET using built-in options and JSON.NET, with examples, pitfalls, and best practices.
How to Convert a String to an Enum in C#
Learn how to convert a string to an enum in C# using Enum.Parse and Enum.TryParse, with examples, mistakes, and best practices.
How to Convert a UTF-8 byte[] to a String in Java
Learn how to convert a UTF-8 byte array to a String in Java, with examples, common mistakes, and real-world usage patterns.
How to Create a Byte Array from a Stream in C# (.NET)
Learn the preferred way to read a Stream into a byte array in C#, including MemoryStream, chunked copying, and common mistakes.
How to Create a Stream from a String in C#
Learn how to generate a Stream from a string in C# for unit tests, file-like input, and text processing with simple examples.
How to Create an Object Instance from a Type in C#
Learn how to create a new object instance from a Type in C# using Activator, reflection, and constructors with simple examples.
How to Enable Fusion Assembly Bind Failure Logging in .NET Framework
Learn how to enable Fusion assembly bind failure logging in .NET Framework, view logs, and troubleshoot assembly loading errors step by step.
How to Encode and Decode Base64 Strings in JavaScript
Learn how to encode and decode Base64 strings in JavaScript, including browser and Node.js examples, common mistakes, and practical use cases.
How to Enumerate an Enum in C#
Learn how to enumerate enum values in C# using Enum.GetValues, foreach, and practical examples with common mistakes explained clearly.
How to Escape Curly Braces in C# String.Format
Learn how to escape literal curly braces in C# String.Format using doubled braces, with examples, mistakes, and practical use cases.
How to Escape Curly Braces in C# and .NET Format Strings
Learn how to escape curly braces in C# and .NET format strings, when to use doubled braces, and how placeholders work in String.Format.
How to Fix 'Metadata file .dll could not be found' in C# WPF
Learn why the C# WPF error 'Metadata file .dll could not be found' happens after failed builds and how to fix project references cleanly.
How to Format Numbers with Thousand Separators in .NET Using String.Format
Learn how to add commas to large numbers in .NET with String.Format, numeric format strings, and culture-aware formatting examples.
How to Format a DateTime as ISO 8601 in C#
Learn how to convert a C# DateTime to an ISO 8601 string like yyyy-MM-ddTHH:mm:ssZ, with examples, pitfalls, and best practices.
How to Generate a Random Integer in C#
Learn how to generate random integers in C# using Random, understand ranges, avoid common mistakes, and see practical examples.
How to Get AssemblyFileVersion in C#
Learn how to read AssemblyFileVersion in C# using reflection and file version APIs, with examples, pitfalls, and practical usage.
How to Get the Application Path in a .NET Console Application
Learn how to get the application path in a .NET console app using AppContext, Assembly, and Environment APIs with clear examples.
How to Get the Current Assembly Path in C#
Learn how to get the path of the assembly containing your code in C#, including pitfalls with unit test runners and reliable alternatives.
How to Get the Integer Value from an Enum in C#
Learn how to get an int value from an enum in C#, cast enums safely, and pass enum values into methods with practical examples.
How to Give a C# Auto-Property an Initial Value
Learn how to initialize C# auto-properties, when to use constructors, and the modern property initializer syntax with clear examples.