<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/XapHttpHandler.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Extension.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Repl.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Window.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/agdlr.css</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/agdlr.js</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/README.markdown</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/TODO</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/README.markdown</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/index.html</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/js/error.js</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/app.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/debugger.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/empty.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/helper.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/__init__.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/__init__.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/child1.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/mod1.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/mod2.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/test.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/test2.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/fixtures/test2.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_01.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_args.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_auto_addref.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_error_handle.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_execfile.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_issubclass.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_modules.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_multi_import.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_name.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_net.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_querystring.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_re.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_s_clock_rb.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_s_dlr_console.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_s_fractulator.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_s_slide.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_smoke.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_sys_path.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_thread.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_utf8.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_attribute_error.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_devidebyzero.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_import_1.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_import_2.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_import_3.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_rethrow.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_syntax_error.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_x_typeerror.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_xamlloader.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_xcode.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/integration/test_xcode_semantics.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/README</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/Rakefile</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/eggxap.bat</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/lib/eggs.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/lib/eggs/empty.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/lib/eggs/lib/bacon/lib/bacon.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/lib/eggs/python.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/sample/app.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/sample/index.html</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/sample/tests/sample_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/lib/eggs/src/Eggs.cs</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/manual/test_domain_loading/index.html</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/manual/test_domain_loading/sub.html</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/manual/test_domain_loading/test/sub.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/manual/test_domain_loading/test/test_domain_loading.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/assets/foo.xaml</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/assets/pkg.xap</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/assets/tmp.txt</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/console_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/dynamic_application_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/extension_types_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/package_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/repl_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Tests/tests/unit/window_test.rb</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/README.markdown</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/chiron-here.reg</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/app/app.py</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/app/app.xaml</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/css/screen.css</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/index.html</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/js/error.js</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.SampleSite/web.config</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/XapHttpHandler.sln</filename>
    </added>
    <added>
      <filename>Merlin/Main/Hosts/SilverLight/Utils/xap-http-handler/update.bat</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -20,7 +20,7 @@
     --&gt;
 
     &lt;!-- the location of language assemblies on disk --&gt;
-    &lt;add key=&quot;localAssemblyPath&quot; value=&quot;../../Libraries/Client&quot; /&gt;
+    &lt;add key=&quot;localAssemblyPath&quot; value=&quot;.&quot; /&gt;
   &lt;/appSettings&gt;
 
   &lt;!--
@@ -55,10 +55,11 @@
     2. the urlPrefix will be added to relative assembly paths
   --&gt;
   &lt;AppManifest.xaml&gt;
-    &lt;Deployment xmlns=&quot;http://schemas.microsoft.com/client/2007/deployment&quot;
-      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
-      RuntimeVersion=&quot;2.0.31005.00&quot;
-      EntryPointAssembly=&quot;Microsoft.Scripting.Silverlight&quot;
+    &lt;Deployment 
+      xmlns=&quot;http://schemas.microsoft.com/client/2007/deployment&quot; 
+      xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot; 
+      RuntimeVersion=&quot;2.0.31005.0&quot;
+      EntryPointAssembly=&quot;Microsoft.Scripting.Silverlight&quot; 
       EntryPointType=&quot;Microsoft.Scripting.Silverlight.DynamicApplication&quot;&gt;
       
       &lt;Deployment.Parts&gt;</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/App.config</filename>
    </modified>
    <modified>
      <diff>@@ -36,6 +36,7 @@ namespace Chiron {
         static bool _saveManifest;
         static string _error;
         static string _startPage;
+        static string[] _localPath;
 
         // these properties are lazy loaded so we don't parse the configuration file unless necessary
         static AppManifestTemplate _ManifestTemplate;
@@ -57,40 +58,52 @@ Copyright (c) Microsoft Corporation.  All rights reserved.
                 Console.WriteLine(
 @&quot;Usage: Chiron [&lt;options&gt;]
 
-General Options:
-
-  /d[irectory]:&lt;path&gt;
-    Specifies directory on disk (default: the current directory)
-
-  /x[ap]:&lt;file&gt;
-    Specifies XAP file to generate
-    Does not start the web server, cannot be combined with /w or /b
-
-  /n[ologo]
-    Suppresses display of the logo banner
-
-  /s[ilent]
-    Suppresses display of all output
-
-Dynamic Language Options:
-
-  /z[ipdlr]:&lt;file&gt;
-    Like /x, but includes files needed for dynamic language apps
-    Does not start the web server, cannot be combined with /w or /b
+Options:
 
   /w[ebserver][:&lt;port number&gt;]
     Launches a development web server that automatically creates
-    XAP files for dynamic language applications
+    XAP files for dynamic language applications (runs /z for every
+    request of a XAP file, but generates it in memory).
     Optionally specifies server port number (default: 2060)
 
   /b[rowser][:&lt;start url&gt;]
     Launches the default browser and starts the web server
     Implies /w, cannot be combined with /x or /z
 
+  /z[ipdlr]:&lt;file&gt;
+    Generates a XAP file, including dynamic language DLLs, and
+    auto-generates AppManifest.xaml (equivalent of /m in memory), 
+    if it does not exist.
+    Does not start the web server, cannot be combined with /w or /b
+
   /m[anifest]
     Saves the generated AppManifest.xaml file to disk
     Use /d to set the directory containing the sources
     Can only be combined with /d, /n and /s
+
+  /d[ir[ectory]]:&lt;path&gt;
+    Specifies directory on disk (default: the current directory)
+
+  /r[efpath]:&lt;path&gt;
+    Path where assemblies are located. Default is same directory
+    as Chiron.exe. Overrides appSettings.localAssemblyPath in 
+    Chiron.exe.config
+
+  /path:&lt;path1;path2;..;pathn&gt;
+    semi-color-separated directories to be included in the XAP file,
+    in addition to what is specified by /d
+
+  /x[ap[file]]:&lt;file&gt;
+    Specifies XAP file to generate. Only XAPs a directory; does not
+    generate a manifest or add dynamic language DLLs; see /z for that
+    functionality.
+    Does not start the web server, cannot be combined with /w or /b
+
+  /n[ologo]
+    Suppresses display of the logo banner
+
+  /s[ilent]
+    Suppresses display of all output
 &quot;);
             }
             else if (_error != null) {
@@ -105,6 +118,7 @@ Dynamic Language Options:
                         XapBuilder.XapToDisk(_dir, _xapfile);
                     } else {
                         ZipArchive xap = new ZipArchive(_xapfile, FileAccess.Write);
+                        XapBuilder.AddPathDirectories(xap);
                         xap.CopyFromDirectory(_dir, &quot;&quot;);
                         xap.Close();
                     }
@@ -181,6 +195,7 @@ Dynamic Language Options:
             _silent = false;
             _nologo = false;
             _help = false;
+            _localPath = new string[]{ };
 
             foreach (string option in args) {
                 if (option[0] != '-' &amp;&amp; option[0] != '/') {
@@ -250,6 +265,9 @@ Dynamic Language Options:
                     _browser = true;
                     _webserver = true;
                     break;
+                case &quot;path&quot;:
+                    ParseAndSetLocalPath(val);
+                    break;
                 case &quot;m&quot;: case &quot;manifest&quot;:
                     _saveManifest = true;
                     break;
@@ -279,6 +297,20 @@ Dynamic Language Options:
                 _help = true;
         }
 
+        internal static void ParseAndSetLocalPath(string pathString) {
+            var __path = new List&lt;string&gt;();
+            string[] paths = pathString.Split(';');
+            foreach (string path in paths) {
+                var fullPath = path;
+                if (!Path.IsPathRooted(path)) 
+                    fullPath = Path.Combine(ChironPath(), path);
+                if (Directory.Exists(fullPath)) {
+                    __path.Add(fullPath);
+                }
+            }
+            _localPath = __path.ToArray();
+        }
+
         public static void Log(int statusCode, string uri, int byteCount, string message) {
             if (!_silent) {
                 if (string.IsNullOrEmpty(message)) {
@@ -292,6 +324,9 @@ Dynamic Language Options:
             }
         }
 
+        internal static string[] LocalPath {
+            get { return _localPath; }
+        }
 
         internal static AppManifestTemplate ManifestTemplate {
             get {
@@ -352,19 +387,22 @@ Dynamic Language Options:
             }
         }
 
+        private static string ChironPath() {
+            return Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
+        }
+
         // Looks for a DLR/language assembly relative to Chiron.exe
         // The path is set in localAssemblyPath in Chiron.exe.config's appSettings section
         internal static string TryGetAssemblyPath(string name) {
             if (_LocalAssemblyPath == null) {
-                string chironPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath);
 
                 _LocalAssemblyPath = ConfigurationManager.AppSettings[&quot;localAssemblyPath&quot;] ?? &quot;&quot;;
                 if (!Path.IsPathRooted(_LocalAssemblyPath)) {
-                    _LocalAssemblyPath = Path.Combine(chironPath, _LocalAssemblyPath);
+                    _LocalAssemblyPath = Path.Combine(ChironPath(), _LocalAssemblyPath);
                 }
                 if (!Directory.Exists(_LocalAssemblyPath)) {
                     // fallback to Chiron install location
-                    _LocalAssemblyPath = chironPath;
+                    _LocalAssemblyPath = ChironPath();
                 }
             }
 </diff>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/Chiron.cs</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,7 @@
   &lt;PropertyGroup&gt;
     &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
     &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
-    &lt;ProductVersion&gt;9.0.21022&lt;/ProductVersion&gt;
+    &lt;ProductVersion&gt;9.0.30729&lt;/ProductVersion&gt;
     &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt;
     &lt;ProjectGuid&gt;{7D07B0CE-FFA3-4402-BFF2-5F42B4267D2A}&lt;/ProjectGuid&gt;
     &lt;OutputType&gt;Exe&lt;/OutputType&gt;
@@ -44,7 +44,14 @@
   &lt;ItemGroup&gt;
     &lt;Reference Include=&quot;System&quot; /&gt;
     &lt;Reference Include=&quot;System.configuration&quot; /&gt;
+    &lt;Reference Include=&quot;System.Core&quot;&gt;
+      &lt;RequiredTargetFramework&gt;3.5&lt;/RequiredTargetFramework&gt;
+    &lt;/Reference&gt;
     &lt;Reference Include=&quot;System.Data&quot; /&gt;
+    &lt;Reference Include=&quot;System.Web&quot; /&gt;
+    &lt;Reference Include=&quot;System.Web.Extensions&quot;&gt;
+      &lt;RequiredTargetFramework&gt;3.5&lt;/RequiredTargetFramework&gt;
+    &lt;/Reference&gt;
     &lt;Reference Include=&quot;System.XML&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
@@ -55,6 +62,7 @@
     &lt;Compile Include=&quot;HttpRequestData.cs&quot; /&gt;
     &lt;Compile Include=&quot;HttpSocket.cs&quot; /&gt;
     &lt;Compile Include=&quot;LanguageInfo.cs&quot; /&gt;
+    &lt;Compile Include=&quot;XapHttpHandler.cs&quot; /&gt;
     &lt;Compile Include=&quot;LCA_RESTRICTED\Zip.cs&quot; /&gt;
     &lt;Compile Include=&quot;MimeTypeSection.cs&quot; /&gt;
     &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
@@ -100,4 +108,4 @@ xcopy /y /d &quot;$(TargetDir)Microsoft.Scripting.Silverlight.dll&quot; &quot;$(ProjectDir)..\t
     &lt;PreBuildEvent&gt;
     &lt;/PreBuildEvent&gt;
   &lt;/PropertyGroup&gt;
-&lt;/Project&gt;
+&lt;/Project&gt;
\ No newline at end of file</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/Chiron.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -617,8 +617,8 @@ namespace Chiron {
         internal const uint SignatureFileEntry = 0x04034b50;
         internal const uint SignatureArchiveDirectory = 0x02014b50;
         internal const uint SignatureArchiveDirectoryEnd = 0x06054b50;
-        internal const ushort VersionNeededToExtract = 0x0100; // version 1.0, TODO
-        internal const ushort MaximumVersionExtractable = 0x0100;
+        internal const ushort VersionNeededToExtract = 0x0014; // version 1.0, TODO
+        internal const ushort MaximumVersionExtractable = 0x0014;
         internal const ushort VersionMadeBy = 0;               // MS-DOS, TODO: should this be NTFS?
         internal const ushort GeneralPurposeBitFlag = 0;       // TODO
         internal const ushort ExtraFieldLength = 0;</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/LCA_RESTRICTED/Zip.cs</filename>
    </modified>
    <modified>
      <diff>@@ -57,12 +57,24 @@ namespace Chiron {
 
             GenerateLanguagesConfig(zip, langs);
 
+            AddPathDirectories(zip);
+
             // add files on disk last so they always overwrite generated files
             zip.CopyFromDirectory(dir, &quot;&quot;);
             
             zip.Close();
         }
 
+        // add directories that are on Chiron's path
+        internal static void AddPathDirectories(ZipArchive zip) {
+            if (Chiron.LocalPath != null) {
+                foreach (var path in Chiron.LocalPath) {
+                    string[] splitPath = path.Split(Path.DirectorySeparatorChar);
+                    zip.CopyFromDirectory(path, splitPath[splitPath.Length - 1]);
+                }
+            }
+        }
+
         // Get the URIs of the assemblies from the AppManifest.xaml file
         private static IList&lt;Uri&gt; GetManifestAssemblies(string manifestPath) {
             List&lt;Uri&gt; assemblies = new List&lt;Uri&gt;();</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Chiron/XapBuilder.cs</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,7 @@ using System.IO;
 using System.Reflection;
 using System.Dynamic;
 using System.Windows;
+using System.Windows.Resources;
 
 namespace Microsoft.Scripting.Silverlight {
 
@@ -33,15 +34,19 @@ namespace Microsoft.Scripting.Silverlight {
     internal sealed class BrowserPAL : PlatformAdaptationLayer {
         internal static readonly BrowserPAL/*!*/ PAL = new BrowserPAL();
         
+        private static StreamResourceInfo _xapFile;
+
+        public StreamResourceInfo XapFile {
+            get { return _xapFile; }
+            set { _xapFile = value; }
+        }
+
         public override bool FileExists(string path) {
-            if (!DynamicApplication.InUIThread) {
-                return false; // Application.GetResourceStream will throw if called from a non-UI thread
-            }
-            return Package.GetFile(path) != null;
+            return Package.GetFile(_xapFile, path) != null;
         }
 
         public override Assembly LoadAssemblyFromPath(string path) {
-            Stream stream = Package.GetFile(path);
+            Stream stream = Package.GetFile(_xapFile, path);
             if (stream == null) {
                 throw new FileNotFoundException(&quot;could not find assembly in XAP: &quot; + path);
             }
@@ -67,7 +72,7 @@ namespace Microsoft.Scripting.Silverlight {
         }
 
         public override Stream OpenInputFileStream(string path) {
-            Stream result = Package.GetFile(GetFullPath(path));
+            Stream result = Package.GetFile(_xapFile, GetFullPath(path));
             if (result == null)
                 throw new IOException(String.Format(&quot;file {0} not found in XAP&quot;, path));
             return result;</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/BrowserPAL.cs</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,19 @@
-&#65279;using System;
+&#65279;/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Reflection;</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Configuration.cs</filename>
    </modified>
    <modified>
      <diff>@@ -24,6 +24,7 @@ using System.Xml;
 using Microsoft.Scripting.Hosting;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
+using System.Net;
 
 namespace Microsoft.Scripting.Silverlight {
 
@@ -112,11 +113,19 @@ namespace Microsoft.Scripting.Silverlight {
             get { return _runtime; }
         }
 
+        internal ScriptEngine Engine {
+            get { return _engine; }
+        }
+
+        internal ScriptScope EntryPointScope {
+            get { return _entryPointScope; }
+        }
         #endregion
 
         #region instance variables
 
         private string _entryPoint;
+        private bool   _consoleEnabled;
         private bool   _debug;
         private bool   _exceptionDetail;
         private bool   _reportErrors;
@@ -132,12 +141,14 @@ namespace Microsoft.Scripting.Silverlight {
 
         private ScriptRuntime _runtime;
         private ScriptRuntimeSetup _runtimeSetup;
+        private ScriptEngine _engine;
+        private ScriptScope _entryPointScope;
 
         internal static bool InUIThread {
             get { return _UIThreadId == Thread.CurrentThread.ManagedThreadId; }
         }
-
         #endregion
+
         #region public API
 
         // these are instance methods so you can do Application.Current.TheMethod(...)
@@ -187,8 +198,51 @@ namespace Microsoft.Scripting.Silverlight {
             return new Uri(baseUri + relativeUri, UriKind.Relative);
         }
 
+        public static ScriptRuntimeSetup CreateRuntimeSetup(IEnumerable&lt;Assembly&gt; assemblies) {
+            ScriptRuntimeSetup setup = Configuration.TryParseFile();
+            if (setup == null) {
+                if (assemblies == null) {
+                    if (!Package.ContainsDLRAssemblies(Deployment.Current.Parts)) {
+                        assemblies = Package.GetExtensionAssemblies();
+                    } else {
+                        assemblies = Package.GetManifestAssemblies();
+                    }
+                }
+                setup = Configuration.LoadFromAssemblies(assemblies);
+            }
+            setup.HostType = typeof(BrowserScriptHost);
+            return setup;
+        }
+
+        public static ScriptRuntimeSetup CreateRuntimeSetup() {
+            return CreateRuntimeSetup(null);
+        }
+
+        public static StreamResourceInfo XapFile {
+            get {
+                return BrowserPAL.PAL.XapFile;
+            }
+            set {
+                BrowserPAL.PAL.XapFile = value;
+            }
+        }
         #endregion
 
+        public static void LoadAssemblies(Action onComplete) {
+            if (!Package.ContainsDLRAssemblies(Deployment.Current.Parts)) {
+                // FIXME: for now, we manually redownload extensions.
+                // A SL bug is stopping us from using Deployment.Current.ExternalParts
+                // to figure out what extensions have been requested by the application.
+                // FIXME: The extensions are downloaded one after the other ... should
+                // be done in parallel.
+                Extension.FetchDLR(delegate() {
+                    onComplete.Invoke();
+                });
+            } else {
+                onComplete.Invoke();
+            }
+        }
+
         #region implementation
 
         /// &lt;summary&gt;
@@ -211,46 +265,51 @@ namespace Microsoft.Scripting.Silverlight {
             ReportUnhandledErrors = true;
 
             ParseArguments(e.InitParams);
-            
-            ScriptRuntimeSetup setup = Configuration.TryParseFile();
-            if (setup == null) {
-                setup = Configuration.LoadFromAssemblies(Package.GetManifestAssemblies());
-            }
 
-            InitializeDLR(setup);
+            DynamicApplication.LoadAssemblies(delegate() {
+                Start();
+            });
+        }
 
+        void Start() {
+            InitializeDLR();
             StartMainProgram();
         }
 
-        private void InitializeDLR(ScriptRuntimeSetup setup) {
-            setup.HostType = typeof(BrowserScriptHost);
+        private void InitializeDLR() {
+            var setup = CreateRuntimeSetup();
             setup.DebugMode = _debug;
-
             setup.Options[&quot;SearchPaths&quot;] = new string[] { String.Empty };
             
             _runtimeSetup = setup;
             _runtime = new ScriptRuntime(setup);
 
             _runtime.LoadAssembly(GetType().Assembly); // to expose our helper APIs
+            LoadDefaultAssemblies(_runtime);
+        }
 
+        public static void LoadDefaultAssemblies(ScriptRuntime runtime) {
             // Add default references to Silverlight platform DLLs
             // (Currently we auto reference CoreCLR, UI controls, browser interop, and networking stack.)
             foreach (string name in new string[] { &quot;mscorlib&quot;, &quot;System&quot;, &quot;System.Windows&quot;, &quot;System.Windows.Browser&quot;, &quot;System.Net&quot; }) {
-                _runtime.LoadAssembly(BrowserPAL.PAL.LoadAssembly(name));
+                runtime.LoadAssembly(GetAssemblyByName(name));
             }
         }
 
+        public static Assembly GetAssemblyByName(string name) {
+            return BrowserPAL.PAL.LoadAssembly(name);
+        }
+
         private void StartMainProgram() {
             string code = Package.GetEntryPointContents();
+            _engine = _runtime.GetEngineByFileExtension(Path.GetExtension(_entryPoint));
+            _entryPointScope = _engine.CreateScope();
 
-            ScriptEngine engine = _runtime.GetEngineByFileExtension(Path.GetExtension(_entryPoint));
+            if (_consoleEnabled)
+                Repl.Show();
 
-            ScriptSource sourceCode = engine.CreateScriptSourceFromString(code, _entryPoint, SourceCodeKind.File);
-
-            // Create a new script module &amp; execute the code.
-            // It's important to use optimized scopes,
-            // which are ~4x faster on benchmarks that make heavy use of top-level functions/variables.
-            sourceCode.Compile(new ErrorFormatter.Sink()).Execute();
+            ScriptSource sourceCode = _engine.CreateScriptSourceFromString(code, _entryPoint, SourceCodeKind.File);
+            sourceCode.Compile(new ErrorFormatter.Sink()).Execute(_entryPointScope);
         }
 
 
@@ -264,6 +323,13 @@ namespace Microsoft.Scripting.Silverlight {
 
             _initParams.TryGetValue(&quot;start&quot;, out _entryPoint);
 
+            string consoleEnabled;
+            if (_initParams.TryGetValue(&quot;console&quot;, out consoleEnabled)) {
+                if (!bool.TryParse(consoleEnabled, out _consoleEnabled)) {
+                    throw new ArgumentException(&quot;You must set 'console' to 'true' or 'false', for example: initParams: \&quot;..., console=true\&quot;&quot;);
+                }
+            }
+            
             string debug;
             if (_initParams.TryGetValue(&quot;debug&quot;, out debug)) {
                 if (!bool.TryParse(debug, out _debug)) {</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/DynamicApplication.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,15 +19,26 @@ using System.Collections.Generic;
 using System.Dynamic;
 using System.Text;
 using System.Windows.Browser;
+using Microsoft.Scripting;
 using Microsoft.Scripting.Hosting;
+using Microsoft.Scripting.Hosting.Providers;
 using Microsoft.Scripting.Runtime;
 using Microsoft.Scripting.Utils;
-using Microsoft.Scripting.Hosting.Providers;
-
 
 namespace Microsoft.Scripting.Silverlight {
 
-    internal static class ErrorFormatter {
+    public static class ErrorFormatter {
+
+        #region Error HTML Template
+        private const string _errorReportId     = &quot;silverlightDlrErrorReport&quot;;
+        private const string _errorMessageId    = &quot;silverlightDlrErrorMessage&quot;;
+        private const string _errorSourceId     = &quot;silverlightDlrErrorSource&quot;;
+        private const string _errorSourceFileId = &quot;silverlightDlrErrorSourceFile&quot;;
+        private const string _errorSourceCodeId = &quot;silverlightDlrErrorSourceCode&quot;;
+        private const string _errorDetailsId    = &quot;silverlightDlrErrorDetails&quot;;
+        private const string _errorTypeId       = &quot;silverlightDlrErrorType&quot;;
+        private const string _errorStackTraceId = &quot;silverlightDlrErrorStackTrace&quot;;
+        private const string _errorLineId       = &quot;silverlightDlrErrorLine&quot;;
 
         // Template for generating error HTML. Parameters are:
         // 0 - message
@@ -35,42 +46,33 @@ namespace Microsoft.Scripting.Silverlight {
         // 2 - source code at error location
         // 3 - error type
         // 4 - stack trace
-        static string _ErrorHtmlTemplate = @&quot;
-&lt;div id=&quot;&quot;silverlightDlrErrorReport&quot;&quot; class=&quot;&quot;silverlightDlrErrorReport&quot;&quot;&gt;
-
-&lt;div id=&quot;&quot;silverlightDlrErrorWrapper&quot;&quot; class=&quot;&quot;silverlightDlrErrorWrapper&quot;&quot;&gt;
-
-  &lt;h2 id=&quot;&quot;silverlightDlrErrorMessage&quot;&quot; class=&quot;&quot;silverlightDlrErrorMessage&quot;&quot;&gt;{0}&lt;/h2&gt;
-
-  &lt;div class=&quot;&quot;silverlightDlrErrorSource&quot;&quot;&gt;
-    
-    &lt;div id=&quot;&quot;silverlightDlrErrorSourceFile&quot;&quot; class=&quot;&quot;silverlightDlrErrorSourceFile&quot;&quot;&gt;{1}&lt;/div&gt;        
-    &lt;code id=&quot;&quot;silverlightDlrErrorSourceCode&quot;&quot; class=&quot;&quot;silverlightDlrErrorSourceCode&quot;&quot;&gt;{2}&lt;/code&gt;
-  
-  &lt;/div&gt;  
-  
-  &lt;div class=&quot;&quot;silverlightDlrErrorDetails&quot;&quot;&gt;
-    
-    &lt;div id=&quot;&quot;silverlightDlrErrorType&quot;&quot; class=&quot;&quot;silverlightDlrErrorType&quot;&quot;&gt;{3}&lt;/div&gt;        
-    &lt;code id=&quot;&quot;silverlightDlrErrorStackTrace&quot;&quot; class=&quot;&quot;silverlightDlrErrorStackTrace&quot;&quot;&gt;{4}&lt;/code&gt;
-
-  &lt;/div&gt;
-
-&lt;/div&gt;
-
-&lt;div class=&quot;&quot;silverlightDlrErrorMenu&quot;&quot; id=&quot;&quot;silverlightDlrErrorHeader&quot;&quot; style=&quot;&quot;display: none&quot;&quot;&gt;
-  &lt;a href=&quot;&quot;javascript:void(0);&quot;&quot; onclick=&quot;&quot;document.getElementById('silverlightDlrErrorFooter').style.display = 'block'; document.getElementById('silverlightDlrErrorWrapper').style.display = 'block'; document.getElementById('silverlightDlrErrorHeader').style.display = 'none'; document.body.style.paddingBottom = '15px';&quot;&quot;&gt;&amp;uArr; {0}&lt;/a&gt;
-&lt;/div&gt;
-
-&lt;div class=&quot;&quot;silverlightDlrErrorMenu&quot;&quot; id=&quot;&quot;silverlightDlrErrorFooter&quot;&quot;&gt;
-  &lt;a href=&quot;&quot;javascript:void(0);&quot;&quot; onclick=&quot;&quot;document.getElementById('silverlightDlrErrorFooter').style.display = 'none'; document.getElementById('silverlightDlrErrorWrapper').style.display = 'none'; document.getElementById('silverlightDlrErrorHeader').style.display = 'block'; document.body.style.paddingBottom = '15px';&quot;&quot;&gt;&amp;dArr; Hide&lt;/a&gt;
-&lt;/div&gt;
+        // 5 - error report id/class
+        // 6 - error message id/class
+        // 7 - error source id/class
+        // 8 - error file id/class
+        // 9 - error source code id/class
+        // 10 - error details id/class
+        // 11 - error type id/class
+        // 12 - error stack trace id/class
+        private static string _errorHtmlTemplate = @&quot;
+&lt;!-- error report html --&gt;
+&lt;h2 class=&quot;&quot;{6}&quot;&quot; id=&quot;&quot;{6}&quot;&quot;&gt;{0}&lt;/h2&gt;
+&lt;div class=&quot;&quot;{7}&quot;&quot;&gt;
+    &lt;div class=&quot;&quot;{8}&quot;&quot; id=&quot;&quot;{8}&quot;&quot;&gt;{1}&lt;/div&gt;
+    &lt;code class=&quot;&quot;{9}&quot;&quot; id=&quot;&quot;{9}&quot;&quot;&gt;
+        {2}
+    &lt;/code&gt;
+&lt;/div&gt;  
+&lt;div class=&quot;&quot;{10}&quot;&quot;&gt;
+    &lt;div class=&quot;&quot;{11}&quot;&quot; id=&quot;&quot;{11}&quot;&quot;&gt;{3}&lt;/div&gt;        
+    &lt;code class=&quot;&quot;{12}&quot;&quot; id=&quot;&quot;{12}&quot;&quot;&gt; 
+        {4}
+    &lt;/code&gt;
+&lt;/div&gt;&quot;;
 
-&lt;/div&gt;
-&quot;;
         // template for highlighted error line, inserted into the silverlightDlrErrorSourceCode div in the template above
-        const string _ErrorLineTemplate = @&quot;&lt;span id=&quot;&quot;silverlightDlrErrorLine&quot;&quot; class=&quot;&quot;silverlightDlrErrorLine&quot;&quot;&gt;{0}&lt;/span&gt;&quot;;
-
+        private const string _errorLineTemplate = @&quot;&lt;span id=&quot;&quot;{1}&quot;&quot; class=&quot;&quot;{1}&quot;&quot;&gt;{0}&lt;/span&gt;&quot;;
+        #endregion
 
         static volatile bool _displayedError = false;
 
@@ -80,44 +82,47 @@ namespace Microsoft.Scripting.Silverlight {
                 return;
             }
             _displayedError = true;
-            try {
 
-                HtmlElement target = HtmlPage.Document.GetElementById(targetElementId);
-                if (target == null) {
-                    // Create a div with this ID
-                    target = HtmlPage.Document.CreateElement(&quot;div&quot;);
-                    if (!string.IsNullOrEmpty(targetElementId)) {
-                        target.Id = targetElementId;
-                    }
-
-                    (HtmlPage.Document.GetElementsByTagName(&quot;body&quot;)[0] as HtmlElement).AppendChild(target);
-                }
+            Window.Show(targetElementId);
+            Repl.Show();
 
-                target.SetProperty(&quot;innerHTML&quot;, FormatErrorAsHtml(e));
+            string result;
 
+            try {
+                result = FormatErrorAsHtml(e);
             } catch (Exception ex) {
-                HtmlPage.Document.GetElementById(targetElementId).SetProperty(&quot;innerHTML&quot;, EscapeHtml(ex.ToString()));
+                result = EscapeHtml(ex.ToString());
             }
+
+            var report = HtmlPage.Document.CreateElement(&quot;div&quot;);
+            report.Id = report.CssClass = _errorReportId;
+            report.SetProperty(&quot;innerHTML&quot;, result);
+            Window.Current.AddPanel(&quot;Error Report (&quot; + EscapeHtml(new DynamicExceptionInfo(e).ErrorTypeName) + &quot;)&quot;, report);
+            Window.Current.Initialize();
+            Window.Current.ShowPanel(report.Id);
         }
 
-        private static string FormatErrorAsHtml(Exception e) {
+        internal static string FormatErrorAsHtml(Exception e) {
 
             // Get information about this exception object
             DynamicExceptionInfo err = new DynamicExceptionInfo(e);
 
-            // Template for generating error HTML. Parameters are:
-            // 0 - message
-            // 1 - source file
-            // 2 - source code at error location
-            // 3 - error type
-            // 4 - stack trace
             return string.Format(
-                _ErrorHtmlTemplate,
+                _errorHtmlTemplate,
                 EscapeHtml(err.Message),
                 err.SourceFileName != null ? EscapeHtml(err.SourceFileName) : &quot;&quot;,
                 FormatSourceCode(err),
                 EscapeHtml(err.ErrorTypeName),
-                FormatStackTrace(err));
+                FormatStackTrace(err),
+                _errorReportId,
+                _errorMessageId,
+                _errorSourceId,
+                _errorSourceFileId,
+                _errorSourceCodeId,
+                _errorDetailsId,
+                _errorTypeId,
+                _errorStackTraceId
+            );
         }
 
         // Print the line with the error plus some context lines
@@ -150,7 +155,7 @@ namespace Microsoft.Scripting.Silverlight {
                     text.Append(&quot;Line &quot;).Append(' ', maxLen - lineNum.Length).Append(lineNum).Append(&quot;: &quot;);
                     lineText = EscapeHtml(lineText);
                     if (i == line) {
-                        text.AppendFormat(_ErrorLineTemplate, lineText);
+                        text.AppendFormat(_errorLineTemplate, lineText, _errorLineId);
                     } else {
                         text.Append(lineText);
                     }
@@ -198,11 +203,11 @@ namespace Microsoft.Scripting.Silverlight {
             return EscapeHtml(ex.StackTrace != null ? ex.StackTrace : ex.ToString());
         }
 
-        private static string EscapeHtml(string str) {
+        public static string EscapeHtml(string str) {
             return HttpUtility.HtmlEncode(str).Replace(&quot; &quot;, &quot;&amp;nbsp;&quot;).Replace(&quot;\n&quot;, &quot;&lt;br /&gt;&quot;);
         }
 
-        internal class Sink : ErrorListener {
+        public class Sink : ErrorListener {
             public override void ErrorReported(ScriptSource source, string message, SourceSpan span, int errorCode, Severity severity) {
                 throw new SyntaxErrorException(message, HostingHelpers.GetSourceUnit(source), span, errorCode, severity);
             }
@@ -212,7 +217,7 @@ namespace Microsoft.Scripting.Silverlight {
         /// Utility class to encapsulate all of the information we retrieve, starting from
         /// the Exception object.
         /// &lt;/summary&gt;
-        private class DynamicExceptionInfo {
+        public class DynamicExceptionInfo {
             public Exception Exception {
                 get { return _exception; }
             }
@@ -259,9 +264,17 @@ namespace Microsoft.Scripting.Silverlight {
                     _sourceLine = _dynamicStackFrames[0].GetFileLineNumber();
                 }
 
-                ScriptEngine engine;
-                if (_sourceFileName != null &amp;&amp;
-                    DynamicApplication.Current.Runtime.TryGetEngineByFileExtension(System.IO.Path.GetExtension(_sourceFileName), out engine)) {
+                ScriptEngine engine = null;
+                if(_sourceFileName.IndexOfAny(Path.GetInvalidPathChars()) == 0) {
+                    var extension = System.IO.Path.GetExtension(_sourceFileName);
+                    DynamicApplication.Current.Runtime.TryGetEngineByFileExtension(extension, out engine);
+                } else {
+                    // running at an interactive prompt, so get the prompt's engine
+                    if (Repl.Current != null &amp;&amp; Repl.Current.Engine != null) {
+                        engine = Repl.Current.Engine;
+                    }
+                }
+                if (_sourceFileName != null &amp;&amp; engine != null) {
                     ExceptionOperations es = engine.GetService&lt;ExceptionOperations&gt;();
                     es.GetExceptionMessage(_exception, out _message, out _errorTypeName);
                 } else {</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/ErrorFormatter.cs</filename>
    </modified>
    <modified>
      <diff>@@ -84,6 +84,16 @@
       &lt;HintPath&gt;$(SilverlightPath)\System.Xml.dll&lt;/HintPath&gt;
       &lt;Private&gt;False&lt;/Private&gt;
     &lt;/Reference&gt;
+    &lt;Reference Include=&quot;System.Data, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, processorArchitecture=MSIL&quot;&gt;
+      &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
+      &lt;HintPath&gt;$(SilverlightPath)\System.Data.dll&lt;/HintPath&gt;
+      &lt;Private&gt;False&lt;/Private&gt;
+    &lt;/Reference&gt;
+    &lt;Reference Include=&quot;System.Net, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, processorArchitecture=MSIL&quot;&gt;
+      &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
+      &lt;HintPath&gt;$(SilverlightPath)\System.Net.dll&lt;/HintPath&gt;
+      &lt;Private&gt;False&lt;/Private&gt;
+    &lt;/Reference&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
     &lt;Compile Include=&quot;..\SilverlightVersion.cs&quot;&gt;
@@ -92,11 +102,18 @@
     &lt;Compile Include=&quot;BrowserPAL.cs&quot; /&gt;
     &lt;Compile Include=&quot;BrowserScriptHost.cs&quot; /&gt;
     &lt;Compile Include=&quot;Configuration.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Extension.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Repl.cs&quot; /&gt;
     &lt;Compile Include=&quot;DynamicApplication.cs&quot; /&gt;
     &lt;Compile Include=&quot;ErrorFormatter.cs&quot; /&gt;
     &lt;Compile Include=&quot;ExtensionTypes.cs&quot; /&gt;
     &lt;Compile Include=&quot;Package.cs&quot; /&gt;
     &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
+    &lt;Compile Include=&quot;Window.cs&quot; /&gt;
+  &lt;/ItemGroup&gt;
+  &lt;ItemGroup&gt;
+    &lt;EmbeddedResource Include=&quot;agdlr.css&quot; /&gt;
+    &lt;EmbeddedResource Include=&quot;agdlr.js&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;Import Project=&quot;$(MSBuildBinPath)\Microsoft.CSharp.targets&quot; Condition=&quot; '$(SilverlightTreeBuild)' != 'true' &quot; /&gt;
   &lt;!-- To modify your build process, add your task inside one of the targets below and uncomment it. </diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Microsoft.Scripting.Silverlight.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,19 @@
-&#65279;using System;
+&#65279;/* ****************************************************************************
+ *
+ * Copyright (c) Microsoft Corporation. 
+ *
+ * This source code is subject to terms and conditions of the Microsoft Public License. A 
+ * copy of the license can be found in the License.html file at the root of this distribution. If 
+ * you cannot locate the  Microsoft Public License, please send an email to 
+ * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
+ * by the terms of the Microsoft Public License.
+ *
+ * You must not remove this notice, or any other, from this software.
+ *
+ *
+ * ***************************************************************************/
+
+using System;
 using System.Collections.Generic;
 using System.Text;
 using System.IO;
@@ -11,12 +26,48 @@ namespace Microsoft.Scripting.Silverlight {
 
         private const string _defaultEntryPoint = &quot;app&quot;;
 
+        private static List&lt;string&gt; _extensionUris = new List&lt;string&gt;() {
+            &quot;http://go.microsoft.com/fwlink/?LinkID=146361&quot;, // Microsoft.Scripting.slvx
+            &quot;http://go.microsoft.com/fwlink/?LinkID=146359&quot;, // IronRuby.slvx
+            &quot;http://go.microsoft.com/fwlink/?LinkID=146360&quot;, // IronPython.slvx
+        };
+
+        private static List&lt;string&gt; _languageAssemblyNames = new List&lt;string&gt;() {
+            &quot;IronRuby&quot;,
+            &quot;IronRuby.Libraries&quot;,
+            &quot;IronPython&quot;,
+            &quot;IronPython.Modules&quot;
+        };
+
+        private static List&lt;string&gt; _dlrAssemblyNames = new List&lt;String&gt;()
+        {
+            &quot;Microsoft.Scripting.Core&quot;,
+            &quot;Microsoft.Scripting&quot;,
+            &quot;Microsoft.Scripting.ExtensionAttribute&quot;,
+            &quot;Microsoft.Scripting.Silverlight&quot;
+        };
+
+        private static List&lt;StreamResourceInfo&gt; _languageAssemblies = new List&lt;StreamResourceInfo&gt;();
+
+        public static List&lt;string&gt; DLRAssemblyNames { get { return _dlrAssemblyNames; } }
+        public static List&lt;string&gt; LanguageAssemblyNames { get { return _languageAssemblyNames; }}
+        public static List&lt;string&gt; LanguageExtensionUris { get { return _extensionUris; }}
+        public static List&lt;StreamResourceInfo&gt; LanguageAssemblies { get { return _languageAssemblies; } }
+
         public static string GetFileContents(string relativePath) {
-            return GetFileContents(new Uri(NormalizePath(relativePath), UriKind.Relative));
+            return GetFileContents(DynamicApplication.XapFile, relativePath);
         }
 
         public static string GetFileContents(Uri relativeUri) {
-            Stream stream = GetFile(relativeUri);
+            return GetFileContents(DynamicApplication.XapFile, relativeUri);
+        }
+
+        public static string GetFileContents(StreamResourceInfo xap, string relativePath) {
+            return GetFileContents(xap, new Uri(NormalizePath(relativePath), UriKind.Relative));
+        }
+
+        public static string GetFileContents(StreamResourceInfo xap, Uri relativeUri) {
+            Stream stream = GetFile(xap, relativeUri);
             if (stream == null) {
                 return null;
             }
@@ -29,17 +80,46 @@ namespace Microsoft.Scripting.Silverlight {
         }
 
         public static Stream GetFile(string relativePath) {
-            return GetFile(new Uri(NormalizePath(relativePath), UriKind.Relative));
+            return GetFileInternal(DynamicApplication.XapFile, relativePath);
         }
 
         public static Stream GetFile(Uri relativeUri) {
-            StreamResourceInfo sri = Application.GetResourceStream(relativeUri);
+            return GetFileInternal(DynamicApplication.XapFile, relativeUri);
+        }
+        
+        public static Stream GetFile(StreamResourceInfo xap, string relativePath) {
+            return GetFileInternal(xap, relativePath);
+        }
+
+        public static Stream GetFile(StreamResourceInfo xap, Uri relativeUri) {
+            return GetFileInternal(xap, relativeUri);
+        }
+
+        private static Stream GetFileInternal(StreamResourceInfo xap, string relativePath) {
+            return GetFileInternal(xap, new Uri(NormalizePath(relativePath), UriKind.Relative));
+        }
+
+        private static Stream GetFileInternal(StreamResourceInfo xap, Uri relativeUri) {
+            StreamResourceInfo sri = null;
+            if (xap == null) {
+                sri = Application.GetResourceStream(relativeUri);
+            } else {
+                sri = Application.GetResourceStream(xap, relativeUri);
+            }
             return (sri != null) ? sri.Stream : null;
         }
 
         public static string NormalizePath(string path) {
             // files are stored in the XAP using forward slashes
-            return path.Replace(Path.DirectorySeparatorChar, '/');
+            string normPath = path.Replace(Path.DirectorySeparatorChar, '/');
+
+            // Application.GetResource doesn't like paths that start with ./ 
+            // TODO try to get this fixed in SL
+            if (normPath.StartsWith(&quot;./&quot;)) {
+                normPath = normPath.Substring(2);
+            }
+
+            return normPath;
         }
 
         public static IEnumerable&lt;Assembly&gt; GetManifestAssemblies() {
@@ -54,6 +134,18 @@ namespace Microsoft.Scripting.Silverlight {
             return result;
         }
 
+        public static IEnumerable&lt;Assembly&gt; GetExtensionAssemblies() {
+            var result = new List&lt;Assembly&gt;();
+            foreach (var sri in LanguageAssemblies) {
+                try {
+                    result.Add(new AssemblyPart().Load(sri.Stream));
+                } catch (Exception) {
+                    // skip
+                }
+            }
+            return result;
+        }
+
         public static string GetEntryPointContents() {
             string code = null;
 
@@ -87,5 +179,32 @@ namespace Microsoft.Scripting.Silverlight {
             }
             return code;
         }
+
+        public static bool ContainsDLRAssemblies(AssemblyPartCollection assemblyPartCollection) {
+            var ret = assemblyPartCollection.Count != 0;
+            
+            foreach (var name in _dlrAssemblyNames) {
+                bool found = false;
+                foreach (AssemblyPart ap in assemblyPartCollection) {
+                    if (string.Format(&quot;{0}.dll&quot;, name) == ap.Source) {
+                        found = true;
+                        break;
+                    }
+                }
+                ret = ret &amp;&amp; found;
+            }
+
+            bool langFound = false;
+            foreach (AssemblyPart ap in assemblyPartCollection) {
+                var rb = string.Format(&quot;{0}.dll&quot;, _languageAssemblyNames[0]);
+                var py = string.Format(&quot;{0}.dll&quot;, _languageAssemblyNames[2]);
+                if(ap.Source == rb || ap.Source == py) {
+                    langFound = true;
+                    break;
+                }
+            }
+
+            return ret &amp;&amp; langFound;
+        }
     }
 }</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Microsoft.Scripting.SilverLight/Package.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,8 @@ Project(&quot;{2150E333-8FDC-42A3-9474-1A3956D46DE8}&quot;) = &quot;Python&quot;, &quot;Python&quot;, &quot;{F26422
 EndProject
 Project(&quot;{2150E333-8FDC-42A3-9474-1A3956D46DE8}&quot;) = &quot;Ruby&quot;, &quot;Ruby&quot;, &quot;{954F903C-ABF7-400B-B23B-F7D461D23841}&quot;
 EndProject
+Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;TestConsoleHost&quot;, &quot;TestConsoleHost\TestConsoleHost.csproj&quot;, &quot;{3C0D0159-3295-4ED3-BC48-961AE99CE15E}&quot;
+EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Microsoft.Scripting&quot;, &quot;..\..\Runtime\Microsoft.Scripting\Microsoft.Scripting.csproj&quot;, &quot;{EB66B766-6354-4208-A3D4-AACBDCB5C3B3}&quot;
 EndProject
 Project(&quot;{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}&quot;) = &quot;Microsoft.Scripting.ExtensionAttribute&quot;, &quot;..\..\..\..\ndp\fx\src\Core\Microsoft\Scripting\Microsoft.Scripting.ExtensionAttribute.csproj&quot;, &quot;{8B0F1074-750E-4D64-BF23-A1E0F54261E5}&quot;
@@ -46,12 +48,18 @@ Global
 		SccProjectTopLevelParentUniqueName5 = Silverlight.sln
 		SccProjectName5 = ../../Languages/Ruby/Libraries.LCA_RESTRICTED
 		SccLocalPath5 = ..\\..\\Languages\\Ruby\\Libraries.LCA_RESTRICTED
+		SccProjectUniqueName6 = ..\\..\\Languages\\JS\\JS.Runtime\\JS.Runtime.csproj
 		SccProjectTopLevelParentUniqueName6 = Silverlight.sln
+		SccProjectName6 = ../../Languages/JS/JS.Runtime
+		SccLocalPath6 = ..\\..\\Languages\\JS\\JS.Runtime
 		SccProjectUniqueName7 = ..\\..\\Languages\\IronPython\\IronPython\\IronPython.csproj
 		SccProjectTopLevelParentUniqueName7 = Silverlight.sln
 		SccProjectName7 = ../../Languages/IronPython/IronPython
 		SccLocalPath7 = ..\\..\\Languages\\IronPython\\IronPython
+		SccProjectUniqueName8 = ..\\..\\Languages\\JS\\JSCompiler\\JSCompiler.csproj
 		SccProjectTopLevelParentUniqueName8 = Silverlight.sln
+		SccProjectName8 = ../../Languages/JS/JSCompiler
+		SccLocalPath8 = ..\\..\\Languages\\JS\\JSCompiler
 		SccProjectUniqueName9 = ..\\..\\Languages\\Ruby\\Ruby\\Ruby.csproj
 		SccProjectTopLevelParentUniqueName9 = Silverlight.sln
 		SccProjectName9 = ../../Languages/Ruby/Ruby
@@ -96,14 +104,6 @@ Global
 		{77323B06-15A2-4CF4-8A7A-86EAA2B66498}.Silverlight Debug|Any CPU.Build.0 = Silverlight Debug|Any CPU
 		{77323B06-15A2-4CF4-8A7A-86EAA2B66498}.Silverlight Release|Any CPU.ActiveCfg = Silverlight Release|Any CPU
 		{77323B06-15A2-4CF4-8A7A-86EAA2B66498}.Silverlight Release|Any CPU.Build.0 = Silverlight Release|Any CPU
-		{357C287E-9839-41D6-B28C-203836500F2A}.Silverlight Debug|Any CPU.ActiveCfg = Silverlight Debug|Any CPU
-		{357C287E-9839-41D6-B28C-203836500F2A}.Silverlight Debug|Any CPU.Build.0 = Silverlight Debug|Any CPU
-		{357C287E-9839-41D6-B28C-203836500F2A}.Silverlight Release|Any CPU.ActiveCfg = Silverlight Release|Any CPU
-		{357C287E-9839-41D6-B28C-203836500F2A}.Silverlight Release|Any CPU.Build.0 = Silverlight Release|Any CPU
-		{588FD769-EEED-4CC1-AA39-2974051746AB}.Silverlight Debug|Any CPU.ActiveCfg = Silverlight Debug|Any CPU
-		{588FD769-EEED-4CC1-AA39-2974051746AB}.Silverlight Debug|Any CPU.Build.0 = Silverlight Debug|Any CPU
-		{588FD769-EEED-4CC1-AA39-2974051746AB}.Silverlight Release|Any CPU.ActiveCfg = Silverlight Release|Any CPU
-		{588FD769-EEED-4CC1-AA39-2974051746AB}.Silverlight Release|Any CPU.Build.0 = Silverlight Release|Any CPU
 		{3C0D0159-3295-4ED3-BC48-961AE99CE15E}.Silverlight Debug|Any CPU.ActiveCfg = Silverlight Debug|Any CPU
 		{3C0D0159-3295-4ED3-BC48-961AE99CE15E}.Silverlight Debug|Any CPU.Build.0 = Silverlight Debug|Any CPU
 		{3C0D0159-3295-4ED3-BC48-961AE99CE15E}.Silverlight Release|Any CPU.ActiveCfg = Silverlight Release|Any CPU
@@ -125,7 +125,5 @@ Global
 		{95289EA9-5778-489D-AB48-F81F2CE2DA32} = {F26422BE-3900-428B-9C8A-7CDD72186EFB}
 		{77323B06-15A2-4CF4-8A7A-86EAA2B66498} = {954F903C-ABF7-400B-B23B-F7D461D23841}
 		{7F6984B4-EE6D-4E6F-ABB1-E210D7DC4FDD} = {954F903C-ABF7-400B-B23B-F7D461D23841}
-		{588FD769-EEED-4CC1-AA39-2974051746AB} = {18EE4124-5E86-4DA6-A827-0A5BEFF7B943}
-		{357C287E-9839-41D6-B28C-203836500F2A} = {18EE4124-5E86-4DA6-A827-0A5BEFF7B943}
 	EndGlobalSection
 EndGlobal</diff>
      <filename>Merlin/Main/Hosts/SilverLight/Silverlight.sln</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,9 @@ using System.Reflection;
 using System.Resources;
 
 [assembly: AssemblyVersion(&quot;2.0.5.0&quot;)]
+
+// Keep the version number set to the initial Silverlight 2 RTW version (2.0.31005),
+// does not need to track the latest Silverlight 2 GDR (2.0.40115).
 [assembly: AssemblyFileVersion(&quot;2.0.31005.0&quot;)]
 [assembly: AssemblyInformationalVersion(&quot;2.0.31005.0&quot;)]
 </diff>
      <filename>Merlin/Main/Hosts/SilverLight/SilverlightVersion.cs</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>12cd15a7e6009523fe3e46141113e2a8187083a7</id>
    </parent>
  </parents>
  <author>
    <name>Jim Deville</name>
    <login></login>
    <email>jdeville@microsoft.com</email>
  </author>
  <url>http://github.com/ironruby/ironruby/commit/33211840f7482ffaa4970a6e630725fad2a70f5d</url>
  <id>33211840f7482ffaa4970a6e630725fad2a70f5d</id>
  <committed-date>2009-06-24T19:46:58-07:00</committed-date>
  <authored-date>2009-06-24T16:02:58-07:00</authored-date>
  <message>Integration from &lt;http://github.com/jschementi/agdlr&gt;:

Microsoft.Scripting.Silverlight
- In-browser Python/Ruby REPL support with initParams console=true.
   o Adds Microsoft.Scripting.Silverlight.Repl type. Renders the REPL using HTML. REPL runs in the same scope as the start-script by default, therefore has the same language as the start-script.
   o Can be instantiated by code as well; see samples/repl.
   o This should be its own assembly in the future to mitigate any &#8220;security&#8221; concerns from users getting access to the REPL. Production apps can remove the assembly.
- Allow importing/requiring on a background thread:
   o Removed UI thread check in FileExists
   o Fixed ErrorReporter bug when _sourceFileName is not a file on disk (e.g. &lt;string&gt;)
       - Not using try/catch for this anymore (jomes review feedback)
- Allows hosts of the DLR load a  self-contained Python or Ruby library (n a XAP file) and ensures requires/imports will work:
   o Enables easy setup of a Ruby testing framework to test C#:
      - &lt;http://blog.jimmy.schementi.com/2009/03/testing-c-silverlight-apps-with.html&gt;
   o Package.GetFile* methods now take an optional StreamResourceInfo argument, representing the XAP file to look for the file in. BrowserPAL also has a XapFile property now for telling it which XAP file to look in.
- Primitive SL3 Extension support
   o Hacky at the moment due to a Silverlight 3 bug (which is fixed in more recent internal builds). Need to hardcode extension URLs.
      - See Silverlight Bugs 31601 and 31873 for context

Chiron
- Zip version fix (sdlsdk CodePlex Bug# 11803)
- Use standard libraries in Silverlight:
   o Add &quot;/path&quot; option to Chiron for a &quot;;&quot;-separated list of folders to get included into the XAP
- Auto-XAP support for IIS:
   o Add XapHttpHander to Chiron, so it can be used to auto-XAP directories for IIS or Cassini (thanks Harry Pierson!)
   o Example in Utils/xap-http-handler
- Launch Chiron by right-clicking on a folder: chiron-here utility

Tests
- Run in one Silverlight application:
- 52 specifications (81 requirements), 0 failures, 0 errors
  o Port Python tests 01, args, auto_addref, error_handle, execfile, and issubclass, from existing TestSuites
  o Unit tests for console, dynamic_application, extension_types, package, and window
- Includes Eggs; makes Bacon (a Ruby spec framework) work in Silverlight. Can be used to test a Python/Ruby app, or a C#/VB app (see testing link above).
- Not running in SNAP yet.

Samples
- Cleans up all samples
- Adds Photoviewer
   o &lt;http://blog.jimmy.schementi.com/2008/08/walk-through-silverlight-flickr-client.html&gt;
- Updates to dlrconsole to fix Ruby and make dragging clock demo work:
   o &lt;http://blog.jimmy.schementi.com/2008/08/dragging-elements-in-silverlight-with.html&gt;
- Adds REPL
- Piano, Tetris, and Surface work again

Misc:
- reflect new template layout for gopackage MSI generation
- Microsoft.Scripting.Helpers.csproj now builds correctly in Silverlight
- JScript removed from Silverlight.sln</message>
  <tree>488a2d7fa2c37f2a1cf251ad609c85bace03378a</tree>
  <committer>
    <name>Jim Deville</name>
    <login></login>
    <email>jdeville@microsoft.com</email>
  </committer>
</commit>
