I think you'll find that the line you think you are getting the error on is not actually where the error is:
objDyn.GenerateTabControls("FS_TaxiMenu", out dynDiv, out gListDynamicControls, true, false, false);
I rather suspect that the error is inside the method
GenerateTabControls
. If you put a breakpoint on this code and step into this method, you should be able to identify the line that is really throwing the exception.