Top ".net" questions

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

"The breakpoint will not currently be hit. The source code is different from the original version." What does this mean?

When debugging in Visual Studio, sometimes I add a breakpoint but it's hollow and VS says "The breakpoint will not …

.net visual-studio debugging
Why does Math.Round(2.5) return 2 instead of 3?

In C#, the result of Math.Round(2.5) is 2. It is supposed to be 3, isn't it? Why is it 2 instead in …

.net rounding
How to mark a method as obsolete or deprecated?

How do I mark a method as obsolete or deprecated using C#?

c# .net versioning deprecated
Better way to check if a Path is a File or a Directory?

I am processing a TreeView of directories and files. A user can select either a file or a directory and …

c# .net file path directory
How to SELECT a dropdown list item by value programmatically

How to SELECT a drop down list item by value programatically in C#.NET?

c# .net drop-down-menu
Create an instance of a class from a string

Is there a way to create an instance of a class based on the fact I know the name of …

c# .net instantiation system.type
Best C# API to create PDF

Can you recomend any PDF API for C#. Free is the best, but I don't mind paying for it.

c# .net api pdf-generation
Using async/await for multiple tasks

I'm using an API client that is completely asynchrounous, that is, each operation either returns Task or Task<T&…

c# .net task-parallel-library async-await c#-5.0
How do I make the return type of a method generic?

Is there a way to make this method generic so I can return a string, bool, int, or double? Right …

c# .net generics return-type
How to read attribute value from XmlNode in C#?

Suppose I have a XmlNode and I want to get the value of an attribute named "Name". How can I …

c# .net xml