问题
Are there any lightweight C# IDEs/compilers? Visual Studio is great but I find it annoying to create an extra project for every single file. Isn't there something like SciTE where you can simply type in the code, compile and run it in the console?
回答1:
Hands down (for me) is LINQPad - it does so much more than LINQ.
http://linqpad.net/
回答2:
Personally I just use a lightweight text editor (jed, or Notepad++) and a separate console. I typically make the console open in c:\users\jon\Test
where there's a Test.cs
file with whatever I've done last - typically including:
using System;
using System.Collections.Generic;
// etc
class Test
{
static void Main()
{
}
}
I normally just get rid of whatever was in Main
before and put in whatever I want.
While compiling from the editor would potentially be handy, I often want to use ILDasm or Reflector, so it's handy having the console open.
You might also want to look at LINQPad which would help you: it has Intellisense, and can build and run code directly. It's particularly aimed at helping with LINQ queries (hence the name) but you can use it in a more general-purpose way too.
回答3:
CS-Script Plugin (CSScript.Npp) is exactly what are you looking for.
回答4:
Take a look to MonoDevelop
回答5:
I used to swear by SnippetCompiler, but LINQPad is awesome for running snippets as well as great LINQ running capabilities. If you use AutoCompletion (license), it's even better.
[Full Disclosure: I know the author of LINQPad, Joe Albahari, but I wouldn't endorse anything that didn't stand on its own merit.]
回答6:
You can also configure Visual Studio to not save the project file when you create one. I do this all the time to explore namespaces. I love Snippet Compiler, but the autocomplete options are not nearly as good.
The option is under Tools > Options > Projects and Solutions > "Save new projects when created" When you uncheck this, it will create a project in a temp directory that will get cleaned up when you close that instance of Visual Studio. Should you choose to save your work, you can use "Save All" to get a dialog that will allow you to specify a save location for the project.
I also took the default text of a Snippet Compiler file and have that as a snippet in Visual Studio. SC's default file wraps your code in a try/catch block and provides shortcut functions for Console.WriteLine().
using System;
using System.Collections.Generic;
public class MyClass
{
public static void RunSnippet()
{
}
#region Helper methods
public static void Main()
{
try
{
RunSnippet();
}
catch (Exception e)
{
string error = string.Format("---\nThe following error occurred while executing the snippet:\n{0}\n---", e.ToString());
Console.WriteLine(error);
}
finally
{
Console.Write("Press any key to continue...");
Console.ReadKey();
}
}
private static void WL(object text, params object[] args)
{
Console.WriteLine(text.ToString(), args);
}
private static void RL()
{
Console.ReadLine();
}
private static void Break()
{
System.Diagnostics.Debugger.Break();
}
#endregion
}
回答7:
#develop is a free Integrated Development Environment (IDE) for C#, VB.NET, Boo, IronPython, IronRuby and F# projects on Microsoft's .NET platform. It is written (almost) entirely in C#, and comes with features you would expect in an IDE plus a few more.
The #develop project started on September 11th, 2000.
http://www.icsharpcode.net/opensource/sd/
回答8:
You will surely like Snippet Compiler.
You might as well like SharDevelop.
来源:https://stackoverflow.com/questions/4256974/what-are-some-lightweight-editors-for-c