Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How 2 create C# Console Application programatically

How 2 create C# Console Application programatically

Scheduled Pinned Locked Moved C#
helpcsharpcomtutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chintan Desai
    wrote on last edited by
    #1

    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)

    N G 2 Replies Last reply
    0
    • C Chintan Desai

      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)

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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.


      My Website | Ask smart questions

      1 Reply Last reply
      0
      • C Chintan Desai

        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)

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        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

        C 1 Reply Last reply
        0
        • G Giorgi Dalakishvili

          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

          C Offline
          C Offline
          Chintan Desai
          wrote on last edited by
          #4

          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)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups