From d33d84ecf9b532fd0e45479a11aaf475b27fcb0d Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 22 Mar 2016 02:41:12 +0400 Subject: [PATCH] (CompilePlugins): add referenced assemblies. --- GameRes/FormatCatalog.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/GameRes/FormatCatalog.cs b/GameRes/FormatCatalog.cs index 58bf4589..cdfb5485 100644 --- a/GameRes/FormatCatalog.cs +++ b/GameRes/FormatCatalog.cs @@ -29,11 +29,11 @@ using System.ComponentModel.Composition; using System.ComponentModel.Composition.Hosting; using System.IO; using System.Linq; -using GameRes.Collections; -using System.Runtime.Serialization.Formatters.Binary; -using Microsoft.CSharp; -using System.Text; using System.CodeDom.Compiler; +using System.Runtime.Serialization.Formatters.Binary; +using System.Text; +using Microsoft.CSharp; +using GameRes.Collections; namespace GameRes { @@ -245,6 +245,12 @@ namespace GameRes } var provider = new CSharpCodeProvider(); var parameters = new CompilerParameters { OutputAssembly = target }; +#if DEBUG + parameters.IncludeDebugInformation = true; +#endif + parameters.ReferencedAssemblies.Add ("System.dll"); + parameters.ReferencedAssemblies.Add ("System.ComponentModel.Composition.dll"); + parameters.ReferencedAssemblies.Add (System.Reflection.Assembly.GetExecutingAssembly().Location); var source = files.Select (f => f.FullName).ToArray(); var results = provider.CompileAssemblyFromFile (parameters, source); if (results.Errors.HasErrors)