Exercise: Solve a Real NullReferenceException Issue

Solve a real NullReferenceException issue when updating a configuration object.

We'll cover the following

Update a configuration object

For this exercise, let’s stop talking about movies. This is a slightly modified version of a real NullReferenceException issue from an open-source content management project.

Imagine that inside our web application, we have a “Setup” page where we can change some security parameters when installing our application from scratch, like the maximum size of parameters in URLs and the size of files to be uploaded.

The SetMaxUploadSize() method changes the maximum size of files to upload to our application. But it’s breaking with a NullReferenceException.

To complete this exercise, feel free to use any technique covered in this minicourse to fix the NullReferenceException.

Get hands-on with 1200+ tech skills courses.