Answer: D. Goes – will have spent
Explanation:
From the options given, note that for the first part, "went" or "gone" can't be the correct option since the event hasn't happened yet as the sale is still forthcoming, therefore, the right word is "goes".
Therefore, the correct sentence will be:
By the time the software (goes) on sale next month, the company will have spent $2 million on developing it.