Attempt to fix compiler warnings and grab libraries for the right framework (net45)

This was my attempt to fix library issues for you
I also fixed some compiler warnings by removing unused variable names in the exception blocks