Sometimes there are resources that are exploited but everyone knows that the resource is very temporary so a city doesn't really grow. Instead, a town forms but never plants roots. For example, the small cities across the Bakken Formation which grew huge transitory populations but no one stays because everyone there knows when the price of oil shifts the Bakken will become unprofitable.
The important thing is attempting to plant a city in the middle of nowhere almost always fails absent very strong government incentives. Washington DC is sort of like that, where it was put where it is because of very strong political incentives (Virginia and Maryland didn't want that land). Brasilia is the other example that jumps to mind, where they wanted the seat of government away from Rio and forced the issue.