the fees for sales and purchase and 1031 exchange are "acquisition cost", it can only be added to the acquisition basis. When you utlimately sold the second property, the capital gain would be reduced because you have a heightened aquisition basis, including the 1031 exchange fees and other sales/purchase cost.