Top ".net" questions

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

Convert string[] to int[] in one line of code using LINQ

I have an array of integers in string form: var arr = new string[] { "1", "2", "3", "4" }; I need to an array of 'real' …

c# .net linq extension-methods
Could not load type from assembly error

I have written the following simple test in trying to learn Castle Windsor's Fluent Interface: using NUnit.Framework; using Castle.…

.net
Cleanest way to write retry logic?

Occasionally I have a need to retry an operation several times before giving up. My code is like: int retries = 3; …

c# .net
How to set selected value from Combobox?

I use combobox in c# windows form. I bound the item list as below: var employmentStatus = new BindingList<KeyValuePair&…

c# .net winforms data-binding combobox
Unrecognized escape sequence for path string containing backslashes

The following code generates a compiler error about an "unrecognized escape sequence" for each backslash: string foo = "D:\Projects\Some\…

c# .net string path escaping
Make an Installation program for C# applications and include .NET Framework installer into the setup

I've finished my C# application, but I have a little problem: When I try to run my application in another …

c# .net winforms visual-studio installation
How to dynamically create a class?

I have a class which looks like this: public class Field { public string FieldName; public string FieldType; } And an object …

c# .net reflection.emit dynamic-class-creation
How to compare DateTime in C#?

I don't want user to give the back date or time. How can I compare if the entered date and …

c# .net datetime
How can I know if a process is running?

When I get a reference to a System.Diagnostics.Process, how can I know if a process is currently running?

c# .net process
How to remove first 10 characters from a string?

How to ignore the first 10 characters of a string? Input: str = "hello world!"; Output: d!

c# asp.net .net string substring