Re: Why doesn't C# allow incremental compilation like Java?



I've looked into that, but it's not possible to do within Visual
Studio (it always compiles projects to dll's). Regardless, it still
makes the project the minimum unit of compilation. It seems like
ideally the time it takes to re-compile should be proportional to the
number of changed classes within a project. Obviously changing the
non-private interface forces the dependencies of a changed class to be
re-compiled, but if I add a single statement to a single method of a
single class it takes exactly the same amount of time to compile as if
I'd added a statement to every class in the project.

Mark

On Apr 19, 10:31 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
That's not true, really. You couldcompileinto individual netmodules
(using the /target:module switch) and then assemble them into an assembly
using the assembly linker tool (al.exe).

You should be able to configure VS.NET 2005 to output a module by
changing the project file (specifically, the inputs to the csc task).

Hope this helps.

--
- Nicholas Paldino [.NET/C#MVP]
- m...@xxxxxxxxxxxxxxxxxxxxxxxxxxx

<mwelsh1...@xxxxxxxxx> wrote in message

news:1177027683.624336.7030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Why doesn't C# allowincrementalcompilation like Java?

Specifically, in Java I cancompilesingle .java files in isolation.
The resulting individual .class files can be grouped into .jar files.

InC#, there appears to be no analog. I have tocompileall my .cs
files into a single .dll.

This has serious drawbacks in terms of compilation. With Eclipse, I
change a file and only that file is re-compiled. With Visual Studio, I
change a file and have to manually re-compile, which may take 10+
seconds for large projects (even if all I did was add a space to a
comment).

Why was this design decision made? And is there any way to speed up
Visual Studio 2005C#compilation? Are there plans to have background
compilation in future versions of Visual Studio?

Thanks.


.



Relevant Pages

  • Re: VS2005 Compilation message
    ... Indeed the solution in question is a mish-mash of 1.1 web app code. ... I just think that V Studio should not flag errors in temp files it itself ... >> I have just started a using VS2005, and have a question regarding compilation. ... I'd recommend working through the tutorials first and see ...
    (microsoft.public.vsnet.general)
  • RE: WSS 3.0 and Sharepoint Server 2007?
    ... a compilation error in the Web site. ... Settings\Administrator\My Documents\Visual Studio ... Only Content controls are allowed directly in a content page that contains ... Error 7 The name 'Label1' does not exist in the current context C:\Documents ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: Problem migrating Web Project from ASP.Net 1.1 to 2.0
    ... conversion throws too many errors. ... > I'm trying to migrate the project to framework 2.0 ... > Initialli I had the following error during the compilation: ... > it could come from assembly 'C:\Visual Studio .Net ...
    (microsoft.public.dotnet.framework.aspnet)
  • Wierd build errors
    ... When I add some controls to web forms in Visual ... Studio 2005 I get build errors on compilation when I refer to them in code ...
    (microsoft.public.dotnet.framework.aspnet)