I feel for you, when I was in college, I also had a hard time putting on weight. Here is what I did to break the cycle.
#1. Get on some creatine. Take 5- 10 grams every day. After the second day you should notice this thirst to drink gatorade by the gallon. After two weeks you should have put on 15-20 lbs of water weight ( muscles saturated with water ). You will notice a huge difference in the gym, plus you might also notice your appetite has increased.
#2. Start eating calorie dense foods. Like PBJ. I used to eat 8 PBJ sandwiches every day. Just as long as its Peanut Butter and something sweet to make it easy to eat ( jelly, Honey, bananas ). If you are having trouble gaining its most likely because you aren't getting enough calories and fats in your diet. Fats are essential for Test.
#3. If you still have trouble putting on weight after that, you might have low test. Try a bottle of Novadex XT for a month.
#4 Finally, Doing exercises like squats, deadlifts, bench, to failure ( til you puke ) is a great way to shock your body.