Hi, I've been researching the CSharpCodeProvider
issue for days everywhere.
I have not been able to find any educational information anywhere.
What is it for, how is it used?
Can you help me with this?
I was able to extract this code snippet with my research, but it doesn't work.
What went wrong
V3 : I don't know how relevant, but I get such a warning, is it relevant?
[url=https://hizliresim.com/Q3LCT7][img]https:
What I have tried:
string Output = "Veryfy.exe";
Dictionary<string, string> version = new Dictionary<string, string>();
version.Add("CompilerVersion", "v2.0");
CSharpCodeProvider codeProvider = new CSharpCodeProvider(version);
ICodeCompiler codeCompiler = codeProvider.CreateCompiler();
CompilerParameters cp = new CompilerParameters();
cp.GenerateExecutable = true;
cp.GenerateInMemory = false;
cp.MainClass = "Veryfy.Program";
cp.OutputAssembly =Output ;
cp.ReferencedAssemblies.Add("system.dll");
cp.ReferencedAssemblies.Add("system.windows.forms.dll");
cp.CompilerOptions = "/target:winexe";
CompilerResults cr = codeCompiler.CompileAssemblyFromSource(cp, Codes());
foreach (CompilerError item in cr.Errors)
{
MessageBox.Show(item.ErrorText);
}
}
string Codes()
{
string code = @"
//Codes
";
code = code.Replace('*', '\"');
return code;
}