6
の別の配列にT4テンプレートコードへのバイト配列を渡します。私は次のコードを使用してアセンブリを作成するためにT4TemplateとのCodeDOMを使用しています同じタイプ
CompilerParameters Params = new CompilerParameters();
Params.GenerateExecutable = true;
Params.ReferencedAssemblies.Add("System.dll");
Params.OutputAssembly = "myfile.exe";
RuntimeTextTemplate1 RTT = new RuntimeTextTemplate1();
string Source = RTT.TransformText();
CompilerResults Create = new CSharpCodeProvider().CompileAssemblyFromSource(Params, Source);
テンプレートは、次のようになります(今のところ) :私は、特定のアプリケーションのいくつかのバイトを含むバイト配列を持つメインアプリケーションで
<#@ template language="C#" #>
namespace Application
{
class Program
{
static void Main()
{
byte[] buffer = new byte[1024];
//And some code for creating a file with the bytes in the buffer.
}
}
}
、これらのバイトは、実行時に、アレイ内にロードされています。
私の質問は次のとおりです。
- 私は(
byte[] buffer = new byte[1024];
)に T4Templateにデータが含まれているバイトの配列(バイト)を渡すことができますどのように アセンブリがで書かれたコードを使用して作成されたときテンプレート、配列 にはバイトが含まれている必要があります。個人的に