Top ".net" questions

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

How to know if a DateTime is between a DateRange in C#

I need to know if a Date is between a DateRange. I have three dates: // The date range DateTime startDate; …

c# .net datetime date-range
Convert string to nullable type (int, double, etc...)

I am attempting to do some data conversion. Unfortunately, much of the data is in strings, where it should be …

c# .net generics extension-methods type-conversion
Select a Dictionary<T1, T2> with LINQ

I have used the "select" keyword and extension method to return an IEnumerable<T> with LINQ, but I …

c# .net linq generics
How to center a label text in WPF?

How to center a label text in WPF? Label HorizontalAlignment="Center" Content="What?" FontSize="25" FontWeight="Bold" Canvas.Top="5"

c# .net wpf
Escape invalid XML characters in C#

I have a string that contains invalid XML characters. How can I escape (or remove) invalid XML characters before I …

c# .net xml escaping
How can I right-align text in a DataGridView column?

How can I right-align text in a DataGridView column? I am writing a .NET WinForms application.

.net winforms datagridview datagridviewcolumn
Can a unit test project load the target application's app.config file?

I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties. The unit …

c# .net unit-testing app-config
How to extract an assembly from the GAC?

There is a package I have to deal with which installs assemblies straight into the GAC (e.g. somewhere deep …

.net assemblies
Drag and drop a DLL to the GAC ("assembly") in windows server 2008 .net 4.0

I've trying to deploy some code to a client machine, where I don't want to install MS windows SDK tools. …

.net .net-4.0 gac
Quickest way to convert a base 10 number to any base in .NET?

I have and old(ish) C# method I wrote that takes a number and converts it to any base: string …

c# .net int base number-systems