Information about Compiling C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have downloaded the .Net Frameworks and have installed it. When I do a listing, I can even see the file csc.exe. Now the trouble is when I compile from the command line, I get error messages. I would like to work in Visual C++ and compile C# from there if it is possible or just save the file and compile from the command line....help!
 
JR said:
I have downloaded the .Net Frameworks and have installed it. When I do
a listing, I can even see the file csc.exe. Now the trouble is when I
compile from the command line, I get error messages. I would like to
work in Visual C++ and compile C# from there if it is possible or just
save the file and compile from the command line....help!

Well, what are the error messages you get? If it's just that it doesn't
understand the command "csc", then you just need to put the framework
directory into your path.
 
.....the errors that I am getting are "csc" is not recognized as an internal or external command, operable program or bacth file.
 
Make sure you have the folder containing CSC.EXE in the PATH environment
variable.
 
also make sure you are compiling from a .Net command prompt (it's located in the Visual Studio .Net Tools folder on the start menu under Visual Studio .Net)...csc won't work from a regular command prompt

ht
jayson
 
Jayson said:
also make sure you are compiling from a .Net command prompt (it's
located in the Visual Studio .Net Tools folder on the start menu under
Visual Studio .Net)...csc won't work from a regular command prompt.

Yes it will. All you need is the path to be correct, from what I
remember. You don't need Visual Studio .NET or even the SDK in order to
compile C#.
 
I have read all the other replies; but there are no samples. Thought I would give you a copy of what I use. My dev server path is too long and csc get's lost when adding so I push it to the front
set oldpath=%path
set cscdrv=c:\WINNT\Microsoft.NET\Framework\v1.0.3705set path=%cscdrv%;%oldpath
csc /t:library /out:n:\inetpub\wwwroot\vslNewResearch\bin\vslRUtils.dll /r:System.Web.dll /r:System.dll /r:System.Data.dll clsResearchUtils.cs
set cscdrv
set path=%oldpath
 
Back
Top