What is a NullReferenceException, and how do I fix it?

What is the cause? Bottom Line You are trying to use something that is null (or Nothing in VB.NET). This means you either set it to null, or you never set it to anything at all. Like anything else, null gets passed around. If it is null in method “A”, it could be that method “B” passed a null to method “A”. null can have different meanings: Object variables … Read more

How do I generate a random int number?

The Random class is used to create random numbers. (Pseudo-random that is of course.). Example: If you are going to create more than one random number, you should keep the Random instance and reuse it. If you create new instances too close in time, they will produce the same series of random numbers as the random generator is seeded from … Read more

.Net 4.8 Support for Windows 10 ends in 26 days?

From what I understand, since Microsoft will not be releasing any new versions of .Net Framework, they have committed to supporting 4.8 indefinitely: .NET Framework 4.8 is the last version of .NET Framework, and no further versions will be released. However, .NET Framework will continue to be serviced with monthly security and reliability bug fixes. Additionally, … Read more

Convert HTML to PDF in .NET

I want to generate a PDF by passing HTML contents to a function. I have made use of iTextSharp for this but it does not perform well when it encounters tables and the layout just gets messy.