How 2 create C# Console Application programatically
-
Hi Buddies, I think this quest will confus you. Wht i wanna to do is tht, I have develop 1 application in C# which can programaticallygenerating one Class file(say class1.cs) in C:\. class1.cs will contain one method which include nos. of exe path which would be invoke one by one after calling this method. In clicking on button I have to compile this file(class1.cs) automatically. If there is any error, redirect it to one text file else create one instant of class1.cs and then call the method. Problem is "how to create whole C# project programatically" and "how to compile this .cs file programatically". Help wud b appreciated.
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
-
Hi Buddies, I think this quest will confus you. Wht i wanna to do is tht, I have develop 1 application in C# which can programaticallygenerating one Class file(say class1.cs) in C:\. class1.cs will contain one method which include nos. of exe path which would be invoke one by one after calling this method. In clicking on button I have to compile this file(class1.cs) automatically. If there is any error, redirect it to one text file else create one instant of class1.cs and then call the method. Problem is "how to create whole C# project programatically" and "how to compile this .cs file programatically". Help wud b appreciated.
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
Chintan.Desai wrote:
"how to create whole C# project programatically"
I don't think that you can create whole C# project programatically. But you can create a C# file ( cs ) since it is a normal text file. Use FileStream to create the file.
Chintan.Desai wrote:
"how to compile this .cs file programatically".
Are you familiar with compiling C# file from command file. ? If yes you can write a bat file which contains these commands and execute the bat file. But regarding Identifying error and coming back to C# file, I don't have much idea.
-
Hi Buddies, I think this quest will confus you. Wht i wanna to do is tht, I have develop 1 application in C# which can programaticallygenerating one Class file(say class1.cs) in C:\. class1.cs will contain one method which include nos. of exe path which would be invoke one by one after calling this method. In clicking on button I have to compile this file(class1.cs) automatically. If there is any error, redirect it to one text file else create one instant of class1.cs and then call the method. Problem is "how to create whole C# project programatically" and "how to compile this .cs file programatically". Help wud b appreciated.
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)
Chintan.Desai wrote:
how to compile this .cs file programatically
You can do it using CSharpCodeProvider class. This article describes how to do it: Mp3ToExe[^]
#region signature my articles #endregion
-
Chintan.Desai wrote:
how to compile this .cs file programatically
You can do it using CSharpCodeProvider class. This article describes how to do it: Mp3ToExe[^]
#region signature my articles #endregion
thanxs,u have solve my quest. Even, I have completed my module this evening. thanx again bye
Regards Chintan www.visharadsoft.com (I am thinking to change humans to computer, but unfortunately GOD will not give me the source code)