Question : CodeDom and Windows Forms

I've been working on a little side project for a while with a few different components. The end product is to be a program that can browse to an SQL file and have it spit out a Windows Forms program using CodeDom (patch creator). The generated programs would then be given to our less technically adept customers to prevent them from messing up their databases and  save our technical support people time.

Initially the end user program started out as a console application and was integrated into the CodeDom application successfully. Things compiled correctly, ran correctly, spit out executables that ran correctly.

After this point it was decided to make the end user program a windows forms application. This was coded stand alone and worked with no issue. Recently I have begun integrating them into the patch creator and I've hit a road block. The the patch creator still compiles programs and at first glance things seem to be working correctly when the created files run, however a console window pops up and seems to be preventing the program from connecting to a database.

My question is this: Is there a parameter or option that must be specified to have the CodeDom Compiler spit out a true windows forms application? No where in my code is there any thing that would cause the console window to open.

If you need to see the code I can provide it.

Thanks -
Rachel

Answer : CodeDom and Windows Forms

CodeDom generates assemblies, and you can either generate them in memory, or to the disk.  The CompilerParameters class has the GenerateInMemory and GenerateExecutable properties, which can control how and where the code is generated.

Example:

CodeDom Calculator - Evaluating C# Math Expressions dynamically
http://www.c-sharpcorner.com/uploadfile/mgold/codedomcalculator08082005003253am/codedomcalculator.aspx
Random Solutions  
 
programming4us programming4us