Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do for example make it possible to pass an argument to the .exe file and read it in my XNA Game?


Enable Editor:

game.exe -devmode

Set Resolution:

game.exe -width 1280 -height 720

and in the game check the arguments before starting the game. I searched for this earlier and thought about it again but found nothing about it.

share|improve this question
up vote 11 down vote accepted

At the end of the day, XNA games are just regular .NET applications.

Read the docs on Main() and args.

You can also use System.Environment.GetCommandLineArgs (link).

share|improve this answer
Yes, I should've thought of that... Just been looking for XNA examples. :) – Deukalion Jan 5 '13 at 22:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.