title: How to get command line from a ClickOnce application?
body: <p>Before publishing I went to Project -> Properties -> Options -> File Associations and added the extension ".hsp". Set an icon and a ProgID ("MyCompany.Document.1" for testing). After I published and installed, my .hsp files had the icon I set, so the file association should be properly set, but when I double clicked one of these files the application run and I expected the name of the file I double clicked to be in the command line. I tried reading the parameter passed to my <code>Main</code> function, tried <code>Environment.CommandLine</code>, and tried <code>Environment.GetCommandLineArgs()</code>, but the only thing I found was the application path. By the way I'm doing all this check before creating my main form in the <code>Main</code> function, just to test. The <code>args</code> parameter is empty and the other two only contain my app path.</p>
  
  <p>This is the beginning of my <code>Main</code> function:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          try
          {
              Application.EnableVisualStyles();
              Application.SetCompatibleTextRenderingDefault(false);
              Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);
              MessageBox.Show("CommandLine -&gt; " + Environment.CommandLine);
              foreach (string str in args) MessageBox.Show("args -&gt; " + str);
              foreach (string str in Environment.GetCommandLineArgs()) MessageBox.Show("GetCommandLineArgs -&gt; " + str);
  </code></pre>