Re: Compile simple C# example in Web Matrix

jason_at_catamaranco.com
Date: 12/12/04


Date: Sun, 12 Dec 2004 15:51:30 -0500

Ok, I figured it out.

To compile the simple howdy, cs one would do the following:

1. Run | Command Prompt
2. CD\ to your DIR containing file
3. Use following statement:

csc /t:library howdcy.cs

However, I was getting the following error (Please see:
http://www.communitymx.com/kbase.cfm?cid=1033)

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

To work around this issue, you must place the path of the command line tools
into the Path system variable. To do so:
  1.. Open the System Properties dialog from the Control Panel, or by right
clicking on My Computer and choosing Properties, or by pressing [windows
key] + [Pause/Break]
  2.. Click on the Advanced tab, and click the Environment Variables
  3.. Highlight the System Variable Path and click edit
  4.. Append the paths to the command line tools to the existing value

By default, those paths are:
c:\program files\microsoft visual studio
.NET\FrameworkSDK\BIN;c:\windows\microsoft.net\framework\v1.1.4322 - if you
installed the SDK with Visual Studio, if you installed only the framework,
the path would likely be:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322

If you'd like more information on using the command line compiler, see the
article:
Demystifying .NET Compilers
http://www.communitymx.com/abstract.cfm?cid=A9938E090C326799

<jason@catamaranco.com> wrote in message
news:%23CC9rOI4EHA.1392@tk2msftngp13.phx.gbl...
> Awesome! I did as intructed and downloaded the SDK and read through the
sdk
> including the 'tools' section.
>
> However, I still don't see any refeence to the C# compiler...where is this
> tool?
>
> Many thanks
> Jason
>
> "V. Jenks" <anonymous@discussions.microsoft.com> wrote in message
> news:12c901c4dfc8$b6433e90$a401280a@phx.gbl...
> I've never used web matrix but as I understand it, it is an
> asp.net development IDE, not made for compiling console
> apps. Correct me if I'm wrong.
>
> Take this modified version of your code:
>
> //BEGIN CODE----------------------------
>
> using System; //added System namespace!
>
> namespace TestClass //added custom namespace!
> {
> // Program start class
> public class HowdyPartner
> {
> // Main begins program execution
> public static void Main(string[] args) //added args!
> {
> // Write to console
> System.Console.WriteLine("Howdy, Partner!");
> }
> }
> }
>
> //END CODE------------------------------
>
> Paste it into notepad and save it as "HowdyPartner.cs"
> (without quotes - and make sure extention is ".cs" not ".txt")
>
> Compile it from the command-line using the C# compiler (csc).
>
> http://www.publicjoe.f9.co.uk/csharp/cs04b2.html
>
> You must have the .net SDK installed, get it here if you
> don't already have it:
>
>
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-9f41-a333c6b9181d&displaylang=en
>
> And off you go!
>
> -v
>
> >-----Original Message-----
> >I am trying to compile a simple c# class in Web Matrix
> called howdy.cs:
> >
> >
> > // Program start class
> > public class HowdyPartner
> > {
> > // Main begins program execution
> > public static void Main()
> > {
> > // Write to console
> > System.Console.WriteLine("Howdy, Partner!");
> > }
> > }
> >
> >However, it appears the 'Start' option is not available.
> What can I do to
> >simply compile this class?
> >
> >I have heard there is a compiler in the SDK but I would
> have thought that
> >would have been downloaded with WebMatrix or the .NET
> framework which is
> >installed on my windowx xp machine.
> >
> >Appreciate some guidance to get my first pathetic C# class
> up and running :)
> >
> >Many thanks
> >Jason
> >
> >
> >.
> >
>
>

begin 666 spacer.gif
K1TE&.#EA`0`!`( ``/_______R'Y! 44````+ `````!``$```("1 $`.P``
`
end



Relevant Pages

  • Re: Compile simple C# example in Web Matrix
    ... I did as intructed and downloaded the SDK and read through the sdk ... namespace TestClass //added custom namespace! ... Compile it from the command-line using the C# compiler. ... > public class HowdyPartner ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Problem in calling c programs and compiling them in tcl/tk
    ... Are you using Tcl's glob command to do this? ... using exec gcc filename.c and later exec ./a.out filename.c. ... the execution of a command that might generate a Tcl error. ... i can call a c program and compile it? ...
    (comp.lang.tcl)
  • RE: Console Application Testing
    ... vbc.exe could be accessed in Visual Studio Command ... If you want to compile the project in command prompt with vbc.exe, ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Macro prompt
    ... I'm sorry, Pcman, I don't think I can help here. ... If you want to test the action of clicking a command button on a form, I suggest you test it by clicking the command button on the form, not by trying to run the Click event code from within the VBE window. ... Steve Schapel, Microsoft Access MVP ... options pop-up menu the the "Compile" section has already checked off Compile ...
    (microsoft.public.access.macros)
  • Re: Using MATLAB functions in C code
    ... interface to MATLAB engine.When I tried to ... option files needed.The command is as follows: ... MATLAB fft amd ifft functions.I just want to compile them like: ... int mlhs, mrhs; ...
    (comp.soft-sys.matlab)