Yeah ... Codedom is better. If somebody wants to screw you up your
dynamic dll they could edit your source code text and let it compile
via your call to compiler. But anyways the dos command you have to run
is something like (depends on your working directory and settings etc)
cmd /k "d:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
When you open the VS command prompt from start menu you could use the
DIR command to check the batch file in the current directory. Actually
this batch file checks your system (x86 or x64) and calls a batch file
in common tools directory that sets the environment variables.
When you use the 'Program' object there must be a overloaded
constructor to accept string params as the second or third parameter
where you could mention the arguments with cmd.
But I am not sure whether you could run CSC commands as well in the
same line.
All said and done CodeDom is the best option.
AT
On Sep 17, 12:45 pm, Cerebrus <[EMAIL PROTECTED]> wrote:
> The Visual Studio Command Prompt (VSCP) is nothing but the Standard
> command window launched with a /K switch and provided a batch file to
> execute. The batch file loads all the environment variables necessary
> for your SDK tools to work. You can do the same and gain access to the
> VSCP.
>
> Personally, however, I would go with the System.CodeDom.Compiler
> classes to do this kind of job.
>
> On Sep 16, 11:07 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
>
> > I have one requirement that I have to create class dynamically and
> > generate .dll for that dynamically created class, Dynamically.
>
> > As such I have created class dynamicallu using stream classes, Now I
> > have to generate .dll for that class. For this, I have to access
> > Visual studio command prompt from c# program to compile the class
> > program.
>
> > I found that if I give Process.Start("cmd.exe"), it is poping up
> > normal command prompt, I know that we can not compile c# programs from
> > normal command prompt as it will not recognize 'csc' command.
>
> > Also Please let me know how to pass arguments to Visual studio command
> > prompt from c# program.
>
> > Please assist me on this problem.
>
> > Thanks and Regards,
> > Pradeep
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web
Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://cm.megasolutions.net/forums/default.aspx
-~----------~----~----~----~------~----~------~--~---