CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2011
    Location
    Buenos Aires, Argentina
    Posts
    130

    App to create, compile and run a VS project.

    Hi, I was wondering about some tutorial creating application that could, given a project template, fill in pieces of code, build and run it. Would that be insanely impossible? Let's say you have some sample code, that you can modify and test to see the results, without having the whole VS interface open.

    We can of course create files and write data to them.
    As far as I know, we can compile a project using MSBuild.
    And we can run an external app given we know where the .exe file is, send parameters and receive the returned values.

    The problem would be the data to be written to each file (for project integrity) and the file references inside the project if new files are to be added. The actual code could then be pasted from a textbox or something.

    Maybe this Project Creating Wizard uses a known tool that I could use independently?

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: App to create, compile and run a VS project.

    Not really sure what you are asking, but in general you can dynamically generate, build and execute code (and even run unit or integration tests on it) - all automatically.

  3. #3
    Join Date
    Jun 2011
    Location
    Buenos Aires, Argentina
    Posts
    130

    Re: App to create, compile and run a VS project.

    Well, exactly that! =)

    The idea would be for someone who does not know much about namespaces, coding, setting up projects or anything to be able to play with the basics and get to see the results of what they are doing.
    To learn about a simple for loop, the whole Visual Studio IDE can get people out of focus.

    What should I be looking into to learn how to do this?

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: App to create, compile and run a VS project.

    Quote Originally Posted by Nikel View Post
    The idea would be for someone who does not know much about namespaces, coding, setting up projects or anything to be able to play with the basics and get to see the results of what they are doing.
    To learn about a simple for loop, the whole Visual Studio IDE can get people out of focus.
    Not sure I agree. Part of learning how to code is to learn and environment to code in. Many beginners struggle and don't understand even the basics of debugging because (IMO) they haven't been properly shown how to in the environment they are using.

    For many languages like C++, it might be a bit unrealistic to cover the basics of the IDE since there are so many to choose from. However, for C# there's only a few IDE's and Visual Studio is at the top of the list.

    For beginners, showing a student how to create a console app project and the basics of debugging (F5, F9, F10, F11, etc) would go a long way.

    To me, learning the basics of the language syntax of something like C# is only scratching the surface of what someone needs to know in order to write code. Knowing the syntax without knowing how to create a project and use the IDE isn't going to get them far.

  5. #5
    Join Date
    Dec 2011
    Location
    .Net 4.0
    Posts
    39

    Re: App to create, compile and run a VS project.

    I agree. I don't think it would be all too great to have a newbie learn some programming steps while skipping major components. I'm a newbie in C# myself. What the world lacks is a good book. Today's books start out with jargon right in the first paragraph, and they really suck because of that. How about starting and ground zero and telling people what a namespace is, why it needs to exist, and how the program uses it "under the hood." Stuff like that....

  6. #6
    Join Date
    Jun 2011
    Location
    Buenos Aires, Argentina
    Posts
    130

    Re: App to create, compile and run a VS project.

    It's all relative, I can give you examples of why I would consider this helpful and you can perhaps help me decide what paths I could follow.

    My father is a Biologist, who once learned enough to write a few lines in Q-Basic, eventually some C. He doesn't care much about what's "under the hood", but he sometimes needs to develop a few simple routines to calculate animal ratios and stuff faster than running calc or Excel and doing all the math himself (with all the error that could yield). He'd be able to do that, but when I showed him the tools he'd have to use, he literally ran away! =)
    As we all know, the tip of the iceberg itself is complicated enough when we talk about VS. On the other hand I do know how (and like) to develop stuff, and could make things easyer for him by taking all the "complicated" stuff out of the way.

    Not everyone who writes software is a software writer/engineer/enthusiast! Myself included! I'm an electronics engineer, who more than once wished he'd have a simple UI to drag and drop buttons and frames around to create simple web pages, have a USB send and receive data and control stuff, and had to learn a lot more to be able to use Visual Studio, when it wasn't my actual intention. Not that I'm complaining anyway, I consider it a very valuable asset.

    That said, I agree with you both that for the case of someone who is learning a new programing language, it is important to know the whys of a lot of things, but for that case, the context is somehow different.

  7. #7
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: App to create, compile and run a VS project.

    To get started writing a console program is easy and only takes a couple of steps:

    1) File\New Project
    2) Visual C#\Windows - Console Application template
    3) Enter a program name and press OK.
    4) Add your code to the main() method.
    Attached Images Attached Images     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured