Sponsored By Aspose - File Format APIs for .NET

Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!

Visual Studio 2008 SP1 "Background Compiling" for C#

I don’t know the proper term for the new functionality in Visual Studio 2008 SP1 for C# that does code anaysis and finds compilation errors without an explicit compile ( what I would term “Background Compilation” ), but Scott Guthrie provides the following description:


“The C# code editor now identifies and displays red squiggle errors for many semantic code issues that previously required an explicit compilation to identify.  For example, if you try to declare and use an unknown type in the C# code-editor today you won’t see a compile error until you do a build.  Now with SP1 you’ll see live red squiggle errors immediately (no explicit compile required):”


Holy time savings Batman, this is much needed functionality for those developers who are not using ReSharper or another tool that provides similar code analysis in the background. I had to jump on my development machine that is not running the Visual Studio 2008 SP1 Beta just to make sure this background compilation wasn’t already being done in Visual Studio 2008.


I didn’t put the feature through a thorough testing, but I was just happy that it would identify unknown classes and other little things. The red squiggles are a huge time saver.


 



 



 


This is worth Visual Studio 2008 SP1 alone. And, no, I don’t know what performance impact this has on large projects :)


 


Recent Visual Studio 2008 SP1 Beta Posts:



 

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

8 Responses to Visual Studio 2008 SP1 "Background Compiling" for C#

  1. David Hayden says:

    Venkat,

    I have heard the same thing about IntelliJ IDEA from JetBrains as well. I think developers coming from the Java world to .NET miss a lot of the functionality they have enjoyed for years from Java tools in the past.

  2. Venkat says:

    It’s there in eclipse for Java from years…Any way great to have this feature….

  3. David Hayden says:

    Chris,

    It is hard to believe, I know :) There are a number of other tools that do not provide “background compiling” or code analysis ( mainly just code highlighting, various macros, etc. ) that a lot of people use and will benefit from this new feature for C# I suspect.

    Personally, I probably won’t use it.

  4. Chris Holmes says:

    “…this is much needed functionality for those developers who are not using ReSharper or another tool that provides similar code analysis in the background.”

    Do those developers really exist?

  5. David Hayden says:

    Neil,

    In the options for the C# editor there are a couple of options that you can turn on and off:

    – Underline errors in the editor.
    – Show live semantic errors.

    It sounds like you have the option to not use this feature if you find it causes you performance problems or is not visually appealing.

  6. David Hayden says:

    I am not sure.

    I suspect Visual Studio 2008 SP1 is just doing a “compile” in the background and displaying compiler related errors. As you know, ReSharper goes well beyond compiler errors and gives you warnings and code suggestions that would not be picked up by the compiler.

    My favorite example of this is ReSharper’s notification icon ( warning ) for an infinite loop in the code :)

  7. So how does this really differ from what R# gives you besides the fact that it is built in?

    Also, wonder how it plays with R#

  8. Neil says:

    I haven’t used this yet, but I really hope that it is not as much of a pain as the equivalent functionality that VB.NET provides. It may be my machine is not zippy enough, but for me in VB it turns coding into a slow and painful experience as after typing keywords your flow of typing is interrupted by VS checking what you have typed.

    I’ve always enjoyed that this did not happen with C#, especially as such mistakes are quite rare, and sometimes intentional (if you haven’t added the method declaration yet but are about – such as when writing a unit test).

    Also will the bottom-left or bottom-right underscores that offer to add using statements, or to implement methods now be obscured by the squiggles? I hope not.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>