0

I am used to write code in VS 2008 < . However now I had to start using Notepad++, and I can't get to run even the HelloWorld program. I followed the steps based in this tutorial: http://www.mastercsharp.com/Article/89/writing-your-first-c-program-hello-world-net-v1-1- I have .NET SDK 2.0 installed, but I still can't get the code running. Basically when I try to execute the file from CMD Propmpt I get a message "HelloWorld" is not recognized as an internal or external command, operable program or batch file. Is there anything else that should be installed? I have everything installed to be able to run the code, but I still can't get it to run. Any help will be apreciated. Thank you!

3
  • That means there is no HelloWorld exe in your current dir or dirs that are on PATH Commented Feb 22, 2013 at 11:39
  • Also stackoverflow.com/questions/861384/… Commented Feb 22, 2013 at 12:12
  • Well my problem was more that the code was not running, and all the solutions I looked up didn't work. Joey gave the answer I was looking for. Anyways thanks for your time :) Commented Feb 22, 2013 at 12:15

3 Answers 3

2

Write your program in Notepad++ (or any other text editor). Then on the console use

C:\Windows\Microsoft.NET\Framework\v2.0.50727\csc.exe HelloWorld.cs

to compile it. Afterwards you can run the generated executable.

Sign up to request clarification or add additional context in comments.

3 Comments

It seems to work, the only problem is that when I run the generated exe it exits really fast so I don't know if it runs it correct or not. Do you have any solution for this?
Put Console.ReadLine() at the end of your code to make it wait for the user to press Return.
I thought you're trying from the console anyway in which case the window should not disappear after your program exists.
1

You can't run HelloWorld.cs, you need to compile it into an executable. Use csc for that.

Or just install Visual Studio Express, it's free.

Comments

-1

You can install CS-Script plugin for Notepad++. The plugin allows execution of the C# code (scripts) directly from Notepad++, without the need for any infrastructure (e.g. project file). It also offers convenient launching of the C# scripts with the system CLR Debugger (e.g. VS) attached.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.