Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

Why is there no Char.Empty like String.Empty?

Is there a reason for this? I am asking because if you needed to use lots of empty chars then …

c# .net string char base-class-library
How do you do Impersonation in .NET?

Is there a simple out of the box way to impersonate a user in .NET? So far I've been using …

c# .net impersonation
How can I find the method that called the current method?

When logging in C#, how can I learn the name of the method that called the current method? I know …

c# .net logging stack-trace system.diagnostics
Convert any object to a byte[]

I am writing a prototype TCP connection and I am having some trouble homogenizing the data to be sent. At …

c# .net object byte
ASP.NET Custom Validator Client side & Server Side validation not firing

This has not happened to me before, but for some reason both the client and server side validation events are …

c# .net asp.net validation customvalidator
DataRow: Select cell value by a given column name

I have a problem with a DataRow that I'm really struggling with. The datarow is read in from an Excel …

c# .net excel datarow
ASP.NET Web Site or ASP.NET Web Application?

When I start a new ASP.NET project in Visual Studio, I can create an ASP.NET Web Application or …

asp.net .net visual-studio projects-and-solutions
How to detect the currently pressed key?

In Windows Forms, you can know, at any time, the current position of the cursor thanks to the Cursors class. …

c# .net winforms keyboard
.NET Format a string with fixed spaces

Does the .NET String.Format method allow placement of a string at a fixed position within a fixed length string. " …

.net string
How do I get formatted JSON in .NET using C#?

I am using .NET JSON parser and would like to serialize my config file so it is readable. So instead …

c# .net json javascriptserializer