This is my compiler function and it works very well. But the output file has no description, like Copyright
, ProductVersion
or FileDescription
:
public static bool CompileFromSource(string source, string output, string icon = null, string[] resources = null)
{
CompilerParameters cParams = new CompilerParameters
{
GenerateExecutable = true,
OutputAssembly = output
};
string options = "/optimize+ /platform:x86 /target:winexe /unsafe";
cParams.CompilerOptions = options;
cParams.TreatWarningsAsErrors = false;
cParams.ReferencedAssemblies.Add("System.dll");
cParams.ReferencedAssemblies.Add("System.Windows.Forms.dll");
cParams.ReferencedAssemblies.Add("System.Drawing.dll");
cParams.ReferencedAssemblies.Add("System.Data.dll");
cParams.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll");
if (resources != null && resources.Length > 0)
{
foreach (string res in resources)
{
cParams.EmbeddedResources.Add(res);
}
}
Dictionary<string, string> providerOptions = new Dictionary<string, string> { { "CompilerVersion", "v2.0" } };
CompilerResults results = new CSharpCodeProvider(providerOptions).CompileAssemblyFromSource(cParams, source);
}
How can i add this descriptions about my file programmatically in this compiler? And i dont want to use third-party app like resourceHacker