Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] starting with c#

Started by cignox1 Oct 19, 2005 at 7:32 AM 9 replies 1.1k views
Original Post
cignox1
cignox1
One hour or two ago I decided to start learning C#, so I downloaded the runtime and sdk packages and installed them. Now I would like to know how to compile the code: if I insert "csc" on the prompt it says that there are non commands with this name, so I suppose that the installation did not setup path and so on. I could add the bin folder to path, but before that I would ask if there is something more to do (like classpath for java), and if it is normal to have it still not configured by the installed. Thank you all.
AvengerDr
AvengerDr
Ciao!

I suppose that it will be better for you to download an IDE such as Microsoft Visual Studio 2005 C# express. It's the 21st century, time to abandon notepad IMO :)
SiCrane
SiCrane
Yes, it's normal for the directory containing the csc executable not to be added to the path.
Arild Fines
Arild Fines
Take a look in the \bin directory of the SDK installation for a batch file named sdkvars.bat. You can run that batch file from a command prompt to set all the necessary environment variables.

The reason the SDK installer doesn't add this to the environment is because MS wants various versions of the SDK to coexist.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
NexusOne
NexusOne
C# kicks ass! Visual Studio doesn't. Stick with notepad.
Graphics make the game! 8-)
cignox1
cignox1
Thank you all. Just adding the bin directory to the path works :-)
Quote:
Original post by AvengerDr
Ciao!

I suppose that it will be better for you to download an IDE such as Microsoft Visual Studio 2005 C# express. It's the 21st century, time to abandon notepad IMO :)


Ciao! :-)
Yes, I heard about it, but I think not to use it, at least now. When I started to learn VC++ I used the visual tools, and this way I was able to make nice GUIs, but still now I don't know how MFC works internally. Instead, with Java I began with notepad, but even if I think to know c++ better than Java, still I'm happy to know how swing and work. I think that I will download some free IDE someday, but I'm going to begin with the basic stuff (that is compiling by hand an so on) as I did with java.
Thank you all for the help!
BradSnobar
BradSnobar
use a gui, at least you can step through your code that way.
AvengerDr
AvengerDr
The fact is that there is so much more in a GUI, that you should seriously consider it. Until VS05 is released, C# Express should be freely downloadable.

By using notepad you'll miss out on the biggest feature ever introduced: the debugger! Without it you'll have to use console output and you'll lose much more time this way. The IDE is a software layer whose purpose is to make your life easier. Code completion features come to mind: back in the old day we coders, being inherently lazy used to have very short variable names because we hated to type a long name each time it would have to be used. Now with code completion features, with as low as 5-6 keypresses you can type a whole line of code.. Instant help with the MSDN.. and refactoring! That's another big feature.

The IDE is all about saving time and making sure that the time you actually spend coding can be as productive as possible. In the end, that is all what you should care for!
cignox1
cignox1
Quote:
Original post by AvengerDr
The fact is that there is so much more in a GUI, that you should seriously consider it. Until VS05 is released, C# Express should be freely downloadable.

By using notepad you'll miss out on the biggest feature ever introduced: the debugger! Without it you'll have to use console output and you'll lose much more time this way. The IDE is a software layer whose purpose is to make your life easier. Code completion features come to mind: back in the old day we coders, being inherently lazy used to have very short variable names because we hated to type a long name each time it would have to be used. Now with code completion features, with as low as 5-6 keypresses you can type a whole line of code.. Instant help with the MSDN.. and refactoring! That's another big feature.

The IDE is all about saving time and making sure that the time you actually spend coding can be as productive as possible. In the end, that is all what you should care for!


:-) Don't worry, currently I don't need c# at all. I'm learning it because I heard that many companies require it (or some other .net language) and I would like to add it to my resume once graduated.
I use Dev-c++ and code::blocks for c++, netbeans for java and the simple ide provided in the ocaml package for ocaml. Then turbo pascal for pascal. I don't use to code with notepad, but I found useful to begin with it before getting an IDE.

daviangel
daviangel
Quote:
Original post by Arild Fines
Take a look in the \bin directory of the SDK installation for a batch file named sdkvars.bat. You can run that batch file from a command prompt to set all the necessary environment variables.

The reason the SDK installer doesn't add this to the environment is because MS wants various versions of the SDK to coexist.

yup. I have vs2003 and vs2005 installed on my machine and have tons of different command prompts that visual studio installs by default. for example here is the batch file it runs for my vs 2003 command prompt:
@SET VSINSTALLDIR=G:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Common7\IDE
@SET VCINSTALLDIR=G:\Program Files (x86)\Microsoft Visual Studio .NET 2003
@SET FrameworkDir=G:\WINDOWS\Microsoft.NET\Framework
@SET FrameworkVersion=v1.1.4322
@SET FrameworkSDKDir=G:\Program Files (x86)\Microsoft Visual Studio .NET 2003\SDK\v1.1
@rem Root of Visual Studio common files.

@if "%VSINSTALLDIR%"=="" goto Usage
@if "%VCINSTALLDIR%"=="" set VCINSTALLDIR=%VSINSTALLDIR%

@rem
@rem Root of Visual Studio ide installed files.
@rem
@set DevEnvDir=%VSINSTALLDIR%

@rem
@rem Root of Visual C++ installed files.
@rem
@set MSVCDir=%VCINSTALLDIR%\VC7

@rem
@echo Setting environment for using Microsoft Visual Studio .NET 2003 tools.
@echo (If you have another version of Visual Studio or Visual C++ installed and wish
@echo to use its tools from the command line, run vcvars32.bat for that version.)
@rem

@REM %VCINSTALLDIR%\Common7\Tools dir is added only for real setup.

@set PATH=%DevEnvDir%;%MSVCDir%\BIN;%VCINSTALLDIR%\Common7\Tools;%VCINSTALLDIR%\Common7\Tools\bin\prerelease;%VCINSTALLDIR%\Common7\Tools\bin;%FrameworkSDKDir%\bin;%FrameworkDir%\%FrameworkVersion%;%PATH%;
@set INCLUDE=%MSVCDir%\ATLMFC\INCLUDE;%MSVCDir%\INCLUDE;%MSVCDir%\PlatformSDK\include\prerelease;%MSVCDir%\PlatformSDK\include;%FrameworkSDKDir%\include;%INCLUDE%
@set LIB=%MSVCDir%\ATLMFC\LIB;%MSVCDir%\LIB;%MSVCDir%\PlatformSDK\lib\prerelease;%MSVCDir%\PlatformSDK\lib;%FrameworkSDKDir%\lib;%LIB%

p.s. charles petzold newest "Programming Windows" book uses c# from the command prompt exclusivly to make windows apps but you'll probably also end up using batch files too if you aren't already.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
Arild Fines
Arild Fines
Quote:
Original post by cignox1
:-) Don't worry, currently I don't need c# at all. I'm learning it because I heard that many companies require it (or some other .net language) and I would like to add it to my resume once graduated.

Said companies will almost certainly ask you for Visual Studio experience as well.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.