Hi,
More information you could give is :
- what steps have you taken so far (Created Project2.cs in notepad ?)
- what error message do you get
- what is the content of your project directory.
Steps I took :
- created a directory c:\temp
- in c:\temp I created a file called Project2.cs
- Opened Project2.cs in Notepad++ and placed the following code in it:
namespace CommandLineTest
{
using System;
internal class Project2
{
private static void Main(string[] args)
{
Console.WriteLine("Hello Project2");
Console.ReadLine();
}
}
}
- Opened a normal command prompt (not a visual studio one, so CSC.exe is not in my environment path and I have to fully qualify it)
- navigated to c:\temp
- Typed C:\Windows\Microsoft.NET\Framework\v4.0.30319\CSC.EXE Project2.cs
- Now I have Project2.exe in C:\Temp and can execute it
Or when you do have a visual studio command prompt
- Opened a Visual Studio command prompt
- navigated to c:\temp
- Typed CSC Project2.cs
- Now I have Project2.exe in C:\Temp and can execute it
Hope this helps,
Here to learn and share. Please tell if an answer was helpful or not at all. This adds value to the answers and enables me to learn more.
About me
No comments:
Post a Comment