4

I plan to use Sublime Text 2 as my code source editor for C#/Java projects and I don't want to install Visual Studio, so can I compile C# project from CLI?

1

5 Answers 5

6

MSBuild is the build system that Visual Studio uses - you can use it directly with solution and project files as they are msbuild files.

It comes with the .NET redistributable downloads.

Note that for many types of solutions you will need to install auxiliary tools (for example resgen if you have any resource generation happening).

Sign up to request clarification or add additional context in comments.

1 Comment

I tried to compile project from VS2010 on machine without VS and MSBuild successfully compile it, but I have warning: The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. How can I fix this trouble? P.S. I've installed .NET Framework Full v4.0.
2

Basically, you can use csc.exe tool, located in c:\Windows\Microsoft.NET\Framework\framework_version\ to compile source files(C#) into executables.

You can create your custom scipt using it and run it to get exe or dll.

2 Comments

I can't imagine using csc for any but the most trivial project (seeing as you need to list all source files on the command line etc...).
Yes, you are right. But i don't know, does Sublime text generate smth like .csproj file? If not, user has to create the list of source files anyway..
0

VS is way more then wrapper for compiler :)

You can configure VS to open files with external tools. Just right click file in solution explorer and choose Open With... Then specify path to your favourite editor and set it as default.

Comments

-1

The only "serious" option left is http://monodevelop.com/

2 Comments

Not sure what you mean by "serious", but then there is also Sharp Develop (icsharpcode.net/OpenSource/SD/Default.aspx). But note that that was not really the question the OP was asking, as he's using Sublime text 2
The OP is not asking for an IDE.
-2

You can use NANT to do so. But you need to have installed the "Windows SDK".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.