Top ".net" questions

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

Difference in months between two dates

How to calculate the difference in months between two dates in C#? Is there is equivalent of VB's DateDiff() method …

c# .net vb.net date
Extension methods must be defined in a non-generic static class

I'm getting the error: Extension methods must be defined in a non-generic static class On the line: public class LinqHelper …

c# .net linq extension-methods compiler-errors
C# difference between == and Equals()

I have a condition in a silverlight application that compares 2 strings, for some reason when I use == it returns false …

c# .net equals
Calculate MD5 checksum for a file

I'm using iTextSharp to read the text from a PDF file. However, there are times I cannot extract text, because …

c# .net hash md5
Implementing INotifyPropertyChanged - does a better way exist?

Microsoft should have implemented something snappy for INotifyPropertyChanged, like in the automatic properties, just specify {get; set; notify;} I think …

c# .net winforms inotifypropertychanged
How to get temporary folder for current user

Currently I am using following function to get the temporary folder path for current user: string tempPath = System.IO.Path.…

c# .net temporary-directory
What Are Some Good .NET Profilers?

What profilers have you used when working with .net programs, and which would you particularly recommend?

c# .net profiling profiler
How can I get my webapp's base URL in ASP.NET MVC?

How can I quickly determine what the root URL is for my ASP.NET MVC application? I.e., if IIS …

.net asp.net asp.net-mvc iis
How to know user has clicked "X" or the "Close" button?

In MSDN I found CloseReason.UserClosing to know that the user had decided to close the form but I guess …

c# .net winforms
Read XML Attribute using XmlDocument

How can I read an XML attribute using C#'s XmlDocument? I have an XML file which looks somewhat like …

c# .net xml xmldocument