There are several issues to address in the question.
It’s easy enough to gain body weight. But, we need to ensure that it is done in a healthy manner. We want to build more muscle (does not mean, we all look like Arnold Schwarzenegger). Need to get Stronger. This will automatically, get you to gain weight. So, it’s good to gain Body Weight, due to Muscle gain, rather than due to more Fat gains.
An important point to note is that, we CANNOT make it like we gain 100% Muscle growth with 0% Fat increase. This is NOT possible. We can skew this towards MORE muscle growth, with a proper Training Program, and with Proper Nutrition.
For those who are presently leading a VERY SEDENTARY lifestyle, ANY activity VASTLY Better than NO Activity.
So, Aerobics will certainly help !!!
But, as a way to keep gaining healthy body weight (see above for discussion on what is healthy body weight), Aerobics is NOT the answer.
Generally, Cardiovascular Workouts do make your body weight go up.
In fact, Extreme Endurance Workouts, are Catabolic (make you lose muscle). Think of world class marathon runners and how they look.
In order to increase your body weight, you need to put on more muscle…that is, get stronger.
This is NOT Isolation/Body Part Split type workouts, which Bodybuilders do (nothing wrong in doing that…but…)
Compound Exercises that workout your entire body are Best for getting your whole body strong and also to put on healthy body weight.
Proper Nutrition and R&R
Of course, none of the above will produce results, unless you have an adequate amount of Rest and Recovery. R&R is as much, if not more, important than the workout itself.
Proper Nutrition (more healthy Proteins and Healthy Fats along with proper amounts o Complex Carbohydrates) are absolutely essential too.
Hope this helps.