where's the .net command prompt?

J

Jwolf

I have .net 2002 edu version and when it installed there was a shortcut to
the .net command prompt. My CLR disk is scratched so I can't reinstall and
so I just downloaded express.

I dont know how to access the command prompt so I can compile basic files
from this book I'm reading. I found this really cool resource here that
would save me a lot of typing by being able to sense which directory I'm in
http://www.codeproject.com/csharp/CommandBar.asp

but when I try to csc myfile.cs it just says

'csc' is not a recognized as an internal or external command, operable
program or batch file.

What to do?
Thanks
 
T

The Other Nice Man

Well the error message means that csc.exe does not exist along any of
the paths defined in the PATH environmental variable.

My command prompt (.Net 2003) uses the following command

%comspec% /k "C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\vsvars32.bat"

There should be a vsvars32.bat file on your machine, this will set all
the environmental variables required (PATH,INCLUDE and LIB).
 
J

Jon Skeet [C# MVP]

Jwolf said:
I have .net 2002 edu version and when it installed there was a shortcut to
the .net command prompt. My CLR disk is scratched so I can't reinstall and
so I just downloaded express.

And have you looked for the batch file in there? Certainly in the
professional edition, vsvars32.bat is in the Common7\Tools directory
under the installation root.
I dont know how to access the command prompt so I can compile basic files
from this book I'm reading. I found this really cool resource here that
would save me a lot of typing by being able to sense which directory I'm in
http://www.codeproject.com/csharp/CommandBar.asp

but when I try to csc myfile.cs it just says

'csc' is not a recognized as an internal or external command, operable
program or batch file.

What to do?

Well, the only really important part of the batch file (as far as most
C# is concerned) is changing the path. Just set the path to include
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
and you should be good to go. (Use c:\WINNT on NT, obviously.)
 
J

Jwolf

I just searched my computer and didn't find vsvars32.bat

I dont have 2003 anymore because one of my installation disks is scratched
and I can't reinstall. I'm using C# express now.

The only thing I have in C:\Program Files\Microsoft Visual Studio
8\Common7\Tools is a vdt folder
 
T

The Other Nice Man

Right Click on My Computer and Select Properties.
Select the Advanced Tab and Press Environmental Variables.
Scroll down System Variables select Path and press edit.
At the end of the line add
;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 Press OK.
OK out of all the dialogs, now everytime you start a command prompt it
should be able to find csc.exe
 
C

Christopher Reed

With the Express products, you may not have a "loaded" command prompt. But
there's still hope.

When you install VS, you also install the .NET SDK which, I believe, is
where the command prompt actually comes from. So, if you download and
install the .NET SDK independent of VS, you will also have a SDK command
prompt.
 
J

Jwolf

TONM, I just tried that but it still does the same thing.

Christopher, I'm downloading the independant installer now... kinda of big
so I'll post back after its done and installed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top