Skip to content

Commit

Permalink
Fixed not all assemblies were loaded shipping with vpm
Browse files Browse the repository at this point in the history
  • Loading branch information
microdee committed Jun 28, 2017
1 parent 24f1127 commit c29eed8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
14 changes: 14 additions & 0 deletions src/vpm/config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ public List<Assembly> ReferencedAssemblies
if (string.IsNullOrWhiteSpace(lass.Location)) continue;
_referencedAssemblies.Add(lass);
}
var vpmfolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
foreach (var file in Directory.GetFiles(vpmfolder, "*.dll"))
{
Assembly ass;
try
{
ass = Assembly.LoadFrom(file);
}
catch (Exception e)
{
continue;
}
_referencedAssemblies.Add(ass);
}
}
return _referencedAssemblies;
}
Expand Down
9 changes: 8 additions & 1 deletion src/vpm/scriptglobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,14 @@ public void Download(string src, string dst)
}
};
var dltask = client.DownloadFileTaskAsync(src, dst);
dltask.Wait();
try
{
dltask.Wait();
}
catch (Exception e)
{
Console.WriteLine("Problem with waiting for downloader. Skipping wait.");
}
Console.ResetColor();
Console.WriteLine("Done");
}
Expand Down
16 changes: 13 additions & 3 deletions src/vpm/vpack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,20 @@ public void Install()
globals: vpmglobal,
options: ScriptOptions.Default.WithReferences(assemblies));
}
catch (CompilationErrorException e)
catch (Exception e)
{
Console.WriteLine("Compilation error:");
Console.WriteLine(string.Join(Environment.NewLine, e.Diagnostics));
if (e is CompilationErrorException)
{
var ee = (CompilationErrorException) e;
Console.WriteLine("Compilation error:");
Console.WriteLine(string.Join(Environment.NewLine, ee.Diagnostics));
}
else
{
Console.WriteLine("Script error:");
Console.WriteLine(e.Message);
Console.WriteLine(e.StackTrace);
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey(true);
VpmUtils.CleanUp();
Expand Down

0 comments on commit c29eed8

Please sign in to comment.