I just want to know if we can compile a single file/class in visual studio.I often change just a single file but end up compiling the entire project.THis might be a trivial case but will be very helpful:) I am using visual studio 2005 working on C# project in .net 2.0
Thanks Luxspes.But i am looking for a way to compile a file in visual studio.I am not looking for a new tool which does this.:)
Ravisha
2010-02-25 07:15:21
A:
The granularity of compilation is the DLL, so there is no way to do what you are asking.
Or do you mean that you compile the whole solution for a singe change (or at least VS checks if all projects require building) ? There is an option under 'project and solution' / 'Build and run', 'only build startup projects and dependencies on Run' that helps.
Edited: Ctrl-f7 for 'build file' is for C++ projects.
Timores
2010-02-25 06:50:44
+1
A:
Ctrl+F7 will compile only the active source file.
Look for the Compile item at the bottom of the Build menu.
Of course, you'll still have to do a build before you can test, but if you just want a quick sanity check after modifying a source file, this can be handy.
Scott Smith
2010-02-25 06:51:03
Scott, you made me quite curious. How do you get a 'Compile' item at the bottom of the Build menu in VS 2005 in a C# project ? I cannot see it on my copy of VS.
Timores
2010-02-25 15:52:37
@Timores - Whoops, I was thinking this was a C++ question; looks like in a C# solution, the smallest thing you can build is a single project, using *Build Selection* (**SHIFT+F6**).
Scott Smith
2010-03-01 00:02:17