Even if this could be achieved, one party in foreign capital flow transactions (either the borrower or the lender) will be exposed to foreign-currency risk, and will have the incentive to unwind the transaction in the face of a threat to the exchange rate.
In this rather unstable world, it is hardly surprising that countries have resisted the upward pressure on exchange rates that accompanies big capital inflows, because they feel (with some justification) that it makes them vulnerable to later sharp depreciation.