开发者

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

开发者 https://www.devze.com 2023-04-11 22:15 出处:网络
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 a

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 cons开发者_如何学JAVAole-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:\

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号