These are really the only two transactions possible. A share sale is a purchase of the corporation itself and typically involves all issued and outstanding shares. With that purchase, you are purchasing the entire history of the corporation at the time of sale. With an asset purchase, the seller doesn’t want to buy the corporation but wants to buy the assets inside it. Any pending matters such as litigation or debt is avoided in an asset sale but would be assumed in a share purchase. Therefore a lot of purchasers will prefer an asset sale, especially when there are distressed assets that have value for them.
On the other hand, if a business has a lot of goodwill (branding, intellectual property) and is being purchased to be operated in perpetuity, it may make sense to do a share purchase. You can mitigate risk by having lawyers go through and check for any pending litigation against the corporation. We highly recommend that in the purchase agreement that there are representations and warranties saying that nothing is being hidden from the purchaser and that no issues will pop up n the next few years.