title: IronPython -> .exe Executable & distribute with all DLLs HELP
body: <p>Been trying to compile this IronPython program into a working .exe for the past 3-4 hours with no luck.</p>
  
  <p>I'm using the pyc.py that came with "IronPython 2.6 for .NET 4.0"</p>
  
  <p><code>D:\IronTestCompile&gt;ipy pyc.py file1.py file2.py /out:Program /main:program.py /target:exe</code></p>
  
  <p>The program compiles out to Program.dll &amp; Program.exe but the Program.exe cannot run.</p>
  
  <p>I'm using this as a guide:</p>
  
  <blockquote>
    <p><a href="http://www.dbaportal.eu/?q=node/142" rel="nofollow noreferrer">IronPython - how to compile exe</a></p>
  </blockquote>
  
  <p>The very simple 'HelloWorld' program I got to work, but my more complex program failed. I'm thinking my complex program failed to run as compiled becaues it's missing DLL's?</p>
  
  <blockquote>
    <p>From IronPython directory I copied all the necessary DLL's (Microsoft*.dll, IronPython*.dll) that are needed for compilation and as run-time prerequisite to run compiled HelloWorld.exe. </p>
  </blockquote>
  
  <p>How can I figure out why my .exe won't run? Or how do I determine what .NET DLL files are needed to be included in the directory? (Assuming I have to put all .NET DLL's in the .exe directory example <code>C:\WINDOWS\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll -&gt; D:\IronTestCompile</code> ? )</p>
  
  <p>The only DLLs I have in the programs directory is:</p>
  
  <pre><code>Microsoft.Scripting.dll
  IronPython.dll
  IronPython.Modules.dll
  Microsoft.Dynamic.dll
  </code></pre>
  
  <p>I do not have <code>Microsoft.Scripting.Core.dll</code> or <code>Microsoft.Scripting.ExtensionAttribute.dll</code> <a href="https://stackoverflow.com/questions/3737690/where-is-microsoft-scripting-core-dll">cause am running IronPython 2.6 for .NET 4.0</a></p>
  
  <p>Should I have more .dll ? My IronPython program uses System.Windows.Forms as well as a bunch of others...</p>
  
  <p>Thanks for any help.</p>
  
  <p>Goal is to compile this program and get all .DLLs in zip file so my brother can unzip &amp; run it on his comp, but as of now I can't even run it in my own comp! Any ideas?</p>
  
  <hr>
  
  <p><strong>EDIT</strong>: So I figured out what was wrong (see my answer below) But now I get this lovely pop-up when trying to run the app on another computer:</p>
  
  <p>Dang, now I get this error when trying to run app on another machine.</p>
  
  <hr>
  
  <h2>MyApp.exe - .NET Framework Initialization Error</h2>
  
  <p>To run this application, you first must install one of the following versions of the .NET Framework:</p>
  
  <p>v4.0.30319</p>
  
  <h2>Contact your application publisher for instructions about obtaining the appropriate version of the .NET Framework.</h2>
  
  <h2>OK</h2>
  
  <p>Wonder if there's any way to get around this.</p>
  
  <p>EDIT:  My fix was, my bro had .NET 3.5  so I re-compiled it on a different machine that had IronPython running .NET 3.5</p>