Microsoft.CSharp.CSharpCodeProvider cscp = new Microsoft.CSharp.CSharpCodeProvider(); System.CodeDom.Compiler.CompilerParameters cp = new System.CodeDom.Compiler.CompilerParameters(); cp.ReferencedAssemblies.Add("System.dll"); cp.ReferencedAssemblies.Add("AxInterop.MSTSCLib.dll"); cp.ReferencedAssemblies.Add("Microsoft.CSharp.dll"); cp.ReferencedAssemblies.Add("Interop.MSTSCLib.dll"); cp.GenerateInMemory = false; cp.GenerateExecutable = true; cp.OutputAssembly = "chilProgram.exe"; System.CodeDom.Compiler.CompilerResults cr = cscp.CompileAssemblyFromSource(cp,"SomeCodeToCompile");
Unhandled exception : System.BadImageFormatException : Could not load file or assembly 'Interop.MSTSCLIP, Version=1.0.0.0 ,Culture neutral, PublicKeyToken=null' or one of dependencies. An attempt was made to load a program with an incorrect format.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)