What is a PDB file?

A PDB file contains information for the debugger to work with. There’s less information in a Release build than in a Debug build anyway. But if you want it to not be generated at all, go to your project’s Build properties, select the Release configuration, click on “Advanced…” and under “Debug Info” pick “None”.

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 can I convert String to Int?

Try this: or better yet: Also, since Int32.TryParse returns a bool you can use its return value to make decisions about the results of the parsing attempt: If you are curious, the difference between Parse and TryParse is best summed up like this: The TryParse method is like the Parse method, except the TryParse method does not throw an exception if the conversion … Read more

An existing connection was forcibly closed by the remote host

This generally means that the remote side closed the connection (usually by sending a TCP/IP RST packet). If you’re working with a third-party application, the likely causes are: You are sending malformed data to the application (which could include sending an HTTPS request to an HTTP server) The network link between the client and server … Read more

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