简体   繁体   中英

How do I get started using Cygwin for C# development?

I'm coming from Linux, and I want to try to learn some C# development.

But I'm partial to the command line and using Vim. Is it easy to set up Cygwin to run the csc compiler from the command line and to edit C# files directly in the console with Vim?

I downloaded SharpDevelop, but I would really like to give console-style C# development a try.

Specifically, how do I set up the PATH (is there an equivalent to .bash_profile?) so that I can run csc and vim from the Windows Console?

I'm running Windows 7.

You should give VsVim a try. With C#, you'll thank yourself for sticking with Visual Studio.

Specifically, how do I set up the PATH (is there an equivalent to .bash_profile?) so that I can run csc and vim from the Windows Console?

Exactly like in linux. The only difference, IIRC, is that you use .bashrc instead of .bash_profile . Edit (or create) the file in your cygwin user's home directory ( ~/ ) and write the usual export PATH=$PATH:/path/to/other/bin lines.

http://www.cygwin.com/cygwin-ug-net/setup-env.html

I love VsVim, as suggested by Joel. But you said you want to try without Visual Studio, so here:

vim integrates well with gnu make , and writing makefiles for C# programs is quite simple.

Just be careful about tabs vs spaces, same as on Linux (and like I'm not doing on SO, since getting tabs in HTML code blocks is hard). You'll just need a rule along the lines of:

myapp.exe : mymain.cs myhelpers.cs mydialog.cs
    csc.exe /o /out:$@ $^

Then from inside vim , you can just use the :make command.

        ProcessStartInfo pInfo = new ProcessStartInfo("C:\\Cygwin\\bin\\mintty.exe");
        pInfo.Arguments = "-i /Cygwin-Terminal.ico -";

if cygwin is installed on C:\\

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM