Click to See Complete Forum and Search --> : some one help me to compile C# program,please


nivedas
January 26th, 2003, 09:32 PM
i have problem in compiling my C# program.i have downloaded the .Net Framework SDK from the www.msdn.com/downloads/default.asp site which is of the size 131MB.now i wud like to know :
1)is the compiler of the C# program present with the .Net SDK?
2)do i need to install the Visual Studio.Net also to compile my C# program ?
3)if i write my C# program where exactly do i write it(mean in which directory/folder)
4)from where do i compile my program(though i know from the command)but from which location(directory).ie is there any particular directory from where the compilation must b done ??

someone please help me.i need it badly for my project .please !!

pareshgh
January 26th, 2003, 10:45 PM
hello,

1)is the compiler of the C# program present with the .Net SDK?
Ans: yes it is. you will need to make a path to compiler and path to assemblies. there will be a batch file which will do that. there are couple of programs which will make you an assembly dll, exe etc.

2)do i need to install the Visual Studio.Net also to compile my C# program ?
Ans: if you are just installing sdk then also it should work. all programs should compile. Visual Studio is an IDE for developing C#.NET, VB.NET etc. based projects. VS.NET is menu driven program where you can drag and drop controls and make your GUI fancy.

3)if i write my C# program where exactly do i write it(mean in which directory/folder)
Ans: after making the neccessary batch files to compile your program (batch programs will contain .bat file and it will accept your .cs C# program file and compile and make executable)
then make your projects folder and according to that manage C# programs folderwise ...

4)from where do i compile my program(though i know from the command)but from which location(directory).ie is there any particular directory from where the compilation must b done ??
Ans: when you will install the .NET SDK then it should come with some .bat which will set your path etc. if you are just using SDK then you just need command prompt to compile programs etc. you could run that either from windows explorer or command promt itself.


hope this will help you,
Paresh

nivedas
January 27th, 2003, 07:47 PM
paresh,
thanks.but let me tell you i am new to C# and i don't know DLLs etc.i will just tell u wat i have done.i have just downloaded the .Net Framework Software Development Kit.Now after i installed my .Net Framework SDK it has created two initial default folders called Visual Studio.Net which has created subdirectories in the hierarchy like Common7 and Vc7 and each of it contains several other directories(in brief the VS.Net cant b used) but my 2nd main inital folder is called Microsoft.Net which contains folder called FrameworkSDK and this folder in turn contains several others like lib,bin,Samples,include etc.now i have written a sample program and i am trying to compile it from the command which is not happening.now in the command if i am trying cd(change directory) to "Microsoft.Net" and to its subdirectories i am not able to which i believe may contain the compiler.now as per your answers....

Originally posted by pareshgh
1)is the compiler of the C# program present with the .Net SDK?
Ans: yes it is. you will need to make a path to compiler and path to assemblies. there will be a batch file which will do that. there are couple of programs which will make you an assembly dll, exe etc.


now how do i create a path to the compiler and to the assemblies?and if it is the batch files that does it then how and from where do i compile my program?

Originally posted by pareshgh

3)if i write my C# program where exactly do i write it(mean in which directory/folder)
Ans: after making the neccessary batch files to compile your program (batch programs will contain .bat file and it will accept your .cs C# program file and compile and make executable)
then make your projects folder and according to that manage C# programs folderwise ...



the reason why i had put up this question was that in the book called "C# Programming With the Public Beta" by the Wrox, i had read that it was asked to compile the program from the directory where the program was written(which obviously makes sense because the compiler would be present)


Originally posted by pareshgh

4)from where do i compile my program(though i know from the command)but from which location(directory).ie is there any particular directory from where the compilation must b done ??
Ans: when you will install the .NET SDK then it should come with some .bat which will set your path etc. if you are just using SDK then you just need command prompt to compile programs etc. you could run that either from windows explorer or command promt itself.




ok.but what is the difference between .Net SDK and just SDK?can u tell me the name of the .bat so that it is easier for me to identify if the downloading or the installation is proper or not.

COOLROCK
January 27th, 2003, 09:34 PM
Dear Friend,
Go to My computer-properties and add where the path of the C# compiler(csc) in Enviroment variables->System variables->Path

For example.IF your csc.exe is under this folder -C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705--
You should add "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705" this string in Path.Like java jvm....

After that you can compile from command promp:

Enjoy it....

nivedas
January 28th, 2003, 01:31 AM
Go to My computer-properties and add where the path of the C# compiler(csc) in Enviroment variables->System variables->Path


thanks.but i did as suggested but i cudnt find environment variables,system variables,path :(



For example.IF your csc.exe is under this folder -C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705--
You should add "C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705" this string in Path.Like java jvm....



yes,this is the actual path created after the installation but friend,as told above i cudnt find anythign like Environment Variables etc in My computer-Properties :(

Please help !!

pareshgh
January 28th, 2003, 04:34 AM
the best i could say is you need to start reading on .NET and C#. from your email it says that you need to start from very basic books. check out MSDN or
GOTDOTNET QUICK START (http://samples.gotdotnet.com/quickstart/)

Paresh

COOLROCK
January 28th, 2003, 08:41 PM
Dear Friend,
Go to My Computer->Properties->Advanced->Enviroment variables->System Varibales->Path

Enjoy it......

nivedas
January 29th, 2003, 07:23 PM
thank you very much coolrock.in the system variables->path the "Variable value" that by default is present is this :


C:\Program Files\Microsoft.NET\FrameworkSDK\Bin\;C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\;C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\;C:\Program Files\Microsoft Visual Studio .NET\Vc7\bin\;%SYSTEMROOT%\system32;C:\ORAWIN95\BIN;"C:\ProgramFiles\WebPublish";%SYSTEMROOT%;%SYSTEMROOT%\system32\WBEM


now do i have to retain the same thing or just delete all except this :


C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\

Nive

COOLROCK
January 29th, 2003, 09:30 PM
Dear nivedas,

I don't interest in your system varivales.I just advice you to add the location string in your path.If you add the path of your csc.exe in system varibables ->path then you can compile your c# program from command line.That's all I can help you.You will see big problems if you delete all contents of system variables ->path ..(You can delete if you r crazy).



P.S.You should also learn the basic things of the O.S b 4 you write C#.....

Good Luck...

pareshgh
February 17th, 2003, 05:56 PM
COOLROCK

how can he write C#.NET programs without learning, he has to try and debug and faces the problem he can write here.. so that's why he wrote here...
I am sure now he must be atleast strong enough...


thanx
Paresh