有时候想实验个C#代码中的小特性,不得不打开VisualStudio,但这实在是太重量级了,如果电脑性能一般的话,光打开VS就得等半天,这里我们可以使用notepad++来运行
在notepad++中新建文件hello.cs,F5运行,配置命令行
cmd /K C:\windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:exe /out:$(FULL_CURRENT_PATH).exe $(FULL_CURRENT_PATH) && $(FULL_CURRENT_PATH).exe文件内容如下:
using System;
public class Program{
static void Main(){
Console.WriteLine("hello c#");
}
}输出
Microsoft(R) Visual C# 2010 编译器 4.0.30319.1 版
版权所有(C) Microsoft Corporation。保留所有权利。
hello c#
本文介绍如何使用Notepad++替代Visual Studio进行简单的C#代码编写与运行测试,通过配置命令行工具实现快速编译及执行,适用于轻量级的代码实验。
281

被折叠的 条评论
为什么被折叠?



