I am developing a website which uses the Facebook login. Now, I want to be able to get this to work both in my production environment, as well as in my development environme
I have the same problem.
The only solutions I have found are:
After I have worked with this for ~6 months, I have found a solution which works really well, based on the other two answers.
In Facebook I add two apps:
Then, in my web.config app settings I have:
<!--Prod-->
<add key="_FacebookApiId" value="id"/>
<add key="_FacebookApiSecretId" value="secret_id"/>
<!--Dev-->
<add key="FacebookApiId" value="dev_id"/>
<add key="FacebookApiSecretId" value="dev_secret_id"/>
Which of course is read through a helper-class.
Then it works seamlessly on both production and localhost, and both myself and my team is happy.
Update: As of 2018 the path to this setting is now Products > Facebook Login > Settings > Client OAuth Settings the rest of this answer is still valid.
There is a better way. You just need to add valid callback URL's for your localhost to Settings > Advanced > OAuth Settings.

This method allows you still have your production website URL while allowing oauth from dev, staging, production, etc.
Following the advice in this answer, it will work if set the Mobile URL to be your development domain (ie. localhost) and the Site URL to be your production domain.
Facebook only allows localhost OAuth redirects when your app is in development mode. This means you can't run your application in production and perform local development tests.
Instead, you need to create a test variant of your app. Head to https://developers.facebook.com and view the dashboard for your production application. Click the drop-down menu at the top-left and choose Create Test App.

This populates a test application with almost the same settings as your production app. However, it gives you a new app ID and app secret, so you'll need to toggle these settings when running in development mode (as other answers suggest).
Here's some further info on test apps: https://developers.facebook.com/docs/apps/test-apps/
The updated way.
In the App Dashboard, choose your app and go to Products > Facebook Login > Settings. Under the Client OAuth Settings, enter your redirect URL in the Valid OAuth redirect URIs field for successful authorization.
Go to https://developers.facebook.com/docs/facebook-login/web for more info.