Announcing: C# Edit and Continue support for Visual Studio 2005


A few weeks ago, I updated my blog by writing about Microsoft’s commitment to VB.Net.  This posting generated a healthy discussion between C# & VB developers with both camps championing their favorite features.  A nice feature for our VB customers in Visual Studio 2005 (and also Visual C++) is ‘Edit & Continue’ (E&C).  For those of you not familiar with E&C, E&C enables you to make changes to your code while an application is being debugged.  Imagine that you are debugging a complex application.  Suddenly, you see that you’ve made an error in your application.  Sighing, you stop the application, make the correction and start the code-compile-debug cycle all over again.  This means that you spend a lot of time recompiling the application even if you’ve changed only one line of code.  E&C changes this and reduces the time required to fix bugs.  In the above scenario, you could just fix the SQL query and continue debugging the application from the same point.

 

One of the top feedback requests from our customers is support for Edit & Continue (E&C) in C# in Visual Studio 2005.  I am excited to announce that the C# team took your feedback to heart and has added support for E&C in Visual Studio 2005.

 

We have always maintained that you should program in the language you’re most comfortable with. If you like E&C but prefer programming in C#, Visual Studio 2005 will enable you to do just that.  This is a great example of the large number of customer driven features in Visual Studio 2005. Adding E&C to Visual C# is currently one of the top requested customer suggestions on the MSDN Product Feedback Center. Visual C# 2005 in Whidbey has been significantly improved by adding innovative language constructs, new compiler features, dramatically enhanced developer productivity, and an improved debugging experience.

 

We will be putting out the next Community Technology Preview for Visual Studio 2005 next week.  This will contain the C# E&C feature.  Give it a whirl and let us know how you like this!

 

Check out this page to see the latest information on Visual Studio 2005 and for a link to the latest Community Technology Preview when we make this available next week. 

 

Namaste!  


Comments (161)

  1. Guayo says:

    Great news!

    Thanks a lot and kudos to the C# team!

  2. That is truly superb news. Thanks for the info.

  3. ToddM says:

    <faint>

    Sweet stuff! It always bugged me that VB was getting this, but not C#. You’ve made me (and I’m sure countless others) very happy.

  4. Hugo Hallman says:

    Fantastic! Greatest news since VS 6!

  5. Jay Nathan says:

    This really wasn’t a new request, though.

    Those of us who started using VS.NET in the original betas were clamoring for it then, and we thought that it was surely going to be included in VS.NET 2003. It was one of those things that was just sort of expected from the new environment, and finding out that it wasn’t there was almost a shock.

    We simply didn’t realize the impact of a new language on a feature that we had come to know and love from the VB development environment.

  6. Rob Cannon says:

    Will the next CTP be integrated with Team System?

  7. Steve Hall says:

    Finally! C# becomes a "First-Class Citizen Language" just like VB! (snicker! snicker!)

  8. That’s great news – thanks!

  9. Sean Chase says:

    Nice! Will it work with ASP.NET? I heard there is some limitations there. What’s the story?

  10. S. Somasegar says:

    Our plan moving forward on VS2005 CTPs is to alternate between the Express editions and the Visual Studio Team System. So, for example this month’s CTP will include the Express editions and the next CTP following that will have VSTS.

  11. The C# team have made C# programmers everywhere happy! Thanks!

  12. http://blogs.msdn.com/somasegar/archive/2004/10/15/242853.aspx I’m totally stoked about this… People have been asking for this since the 1.0 (VS 7.0). Kudos to the entire E&amp;C team….

  13. It’s official: Edit and Continue will be in C# 2.0. Thank you!…

  14. Yaiz says:

    Cool, is the My namespace comming to c# too

  15. S. Somasegar says:

    No immediate plans for adding the My namespace to c#.

  16. DNA says:

    C# E&C = Productivity^2

  17. Jekke Bladt says:

    Edit and Continue in C#

  18. Jekke Bladt says:

    Edit and Continue in C#

  19. Jekke Bladt says:

    Edit and Continue in C#

  20. Deepa Gill says:

    How stable is it going to be, so late in the release cycle?

  21. S. Somasegar says:

    I would rather have you try it out with the CTP drop and let me know :).

    Seriously, the team has been working on this for a while now. We absolutely feel that it will be high quality by the time we ship, otherwise I would not have included that in the product.

    Looking forward to hearing your feedback.

  22. Deepa Gill says:

    Thank you for your excellent feedback. Very excited to try it out. So are the VB guys getting refectoring? 😉

  23. Mike Flasko says:

    One of the best VB features in c# now – right on!

  24. You have restored my faith in MSFT and it’s commitment to developers and what they are asking for!

  25. Chris says:

    How about making the current debugger work correctly – then I’ll faint with joy.

  26. Terence Ting says:

    Thank you. Thank you. Thank you….. from a guy who had done VB6 for 7 years.

  27. norlan says:

    YAHOOOOOOOOO, thank you C# Team

  28. Jared Evans says:

    Thanks! This will be very useful and cut down on development time!

  29. karim says:

    Sounds cool. But is it availabel in the VS2005 Express edition ?

  30. Will it also be available in the C# Express Edition, or only in VS2005?

  31. uwe says:

    So the release date will be delayed further?

  32. S. Somasegar says:

    Edit and continue for both C# and VB does not work for ASP.NET. There were two major reasons for this. The first and by far the most important reason is that the ASP.NET team felt that their current model was already incredibly iterative even without E&C and that trying to apply the same model that we use for client apps would actually be more restrictive. The reason is that the ASP.NET model is generally compile on the server. So in order to get updated changes, see new content, hit breakpoints on newly added code, you can just hit F5 on the page in IE to refresh. That hits the server and tells ASP.NET to recompile the changes. If we were to use an E&C model instead then the set of ‘rude edit’ restrictions would need to be in place, so it would suddenly become illegal to add new public methods.

    The second reason was simply that it was technically difficult to do and even in the very early planning stages of E&C for Whidbey both VS and the CLR were trying to limit the scope such that we didn’t end up in the same position with E&C that we did for 2002.

  33. Will we be able to use Edit & Continue in assemblies referenced by an ASP.NET project as we execute a page? (if that makes sense…)

  34. S. Somasegar says:

    Several people have asked me about whether Edit & Continue will be in the Express Edition of the product.

    The answer is – absolutely yes!

    This is true for E&C both for VB Express and C# Express in VS2005.

    – somasegar

  35. denoir says:

    Thank you. Thank you. Thank you :-)

    This will truly be a great time saver for those of us working on larger projects that take a long time to start up.

  36. Anonymous says:

    S dot One heeft het over .NET &raquo; C# vs VB.Net : 1 – 0

  37. VS 2005 – C# でもエディット&コンティニューをサポート

  38. Fantastic. I was really thinking about going back to VB.NET because of E&C (Yes, it is that important!). Now I can continue in my favorite language.

  39. Sergio Pereira says:

    Soma, this is great news. Could you elaborate more on the "not works in ASP.NET" part ? I mean, like many of the folks out there, 80% of all the code I write in .Net is to be used ultimately in an ASP.NET application. Are you saying that I’ll only be able to use E&C in .exe projects or .dlls being used in .exe projects ? Or something liek this? That would be a let down for me.

  40. Ulixes says:

    Thank you very much!

    The idea of MS Feedback Center is really great, I think it will be a powerful instrument.

  41. dank says:

    Cool News, now C# programmers will have time to wash their hair!

  42. Sudhakar says:

    Well, Microsoft has got a big set of ears :-)

  43. Just seen this one wander past, edit &amp; continue is (finally) in C#.http://blogs.msdn.com/somasegar/archive/2004/10/15/242853.aspxI've always liked it in VB6 but it does awful things for your stability (unsurprising really). It’s just so nice to have w

  44. Woo Seok Seo says:

    Very very good job!!!!

  45. Amir says:

    It’s nice, but the most important thing is to put in massive refactoring and intelligent code generation features – above and beyond any E&C features.

    And if you really want to get dirty, then the above for C++ is absolutely crudial nowadays…

  46. ms44cn says:

    Wonderful

    Thanks Microsoft

    Like it.

  47. Thank you very much! E&C was my most missed feature for C# ever… :)

  48. Saravana says:

    Edit and Continue for C# in VS 2005

  49. Peťův blog says:

    Jak se dozvídám na http://blogs.msdn.com/somasegar/archive/2004/10/15/242853.aspx&#160;, v další Community Technology Preview verzi bude tato již dlouho požadovaná featura přidána. Visual Studio 2005 se tímto posouvá o další úroveň výše, mnohé díky směřují jeh

  50. So, its been 2 weeks but I have not seen another communitey tech preview of VS 2005. Any news on when that will actually be coming?

  51. S. Somasegar says:

    You can get the latest Community Technology Preview for VS2005 (October drop) at

    http://lab.msdn.microsoft.com/vs2005/downloads/default.aspx.

  52. JavaKid says:

    Thanks for pointing me to the MSDN Product Feedback Center. That is exactly what I have been looking for. I will be making several suggestions over the next couple of months. There are so many opportunities for growth within Visual Studio .Net, hopefully by actively participating within the community Microsoft will listen and we can start to turn it into the powerful IDE that we all expect.

  53. S. Somasegar says:

    Looking forward to seeing your suggestions and input via MSDN Feedback Center. Together, we can absolutely build and deliver something that we all want.

  54. cwillis says:

    This is very nice to hear. However, I understand ASP.NET does not support E&C. Which projects types do support it? I assume WinForms, but do console apps and class library projects support E&C?

    Along these lines, if Winforms support E&C, could you drop the cassinni web server code (or something similar) in to a winform exe and thus get E&C to work for ASP.NET pages, under C# no less?

  55. S. Somasegar says:

    I have heard several requests for information on whether E&C would work for ASP.NET. Somebody even asked whether we could make it work by dropping the cassini web server code.

    First of all, E&C will work for all types of Client apps, class libraries, console apps, windows forms, etc.

    In VS 2005, it’s not possible to use E&C in ASP.NET pages even while debugging the cassinni source. In this case it would be possible to manipulate the web server code itself, but not the pages that were loaded and executed. The work needed to support E&C for ASP.NET has less to do with the interaction with the web server and more to do with the general compilation model that ASP.NET uses. In order to correctly support E&C Visual Studio must have tight communication between the debugger, compiler, project system and language service (IntelliSense). In ASP.NET the code which will ultimately be loaded and executed is generated and compiled through the CodeDom which shells out to the command line compiler. This causes problems for the language service, compiler, and project system interaction because the code which is actually run isn’t known by any entity other then the worker process. Therefore detecting edits that shouldn’t be allowed as well as determining the correct methods to recompile and emit is not currently possible.

    I have been watching the posts with respect to supporting E&C in ASP.NET, and given the amount of feedback it’s definitely something that we’ll look at for the future. Interestingly it may be a reaction that changes over time. In the comments here http://blogs.msdn.com/jaybaz_ms/archive/2004/10/15/242884.aspx#FeedBack, cwillis felt that:

    “Thanks!! I wanted to switch from VB to C#, but wasn’t because E&C was only in VB. Now I can. This actually changes my image of Microsoft. They do listen!

    Now…. no one is ever satisfied are they? How abouts getting E&C to work under ASP.NET? Web developers like to be productive too! :)”

    However, after a day or two of playing around with the product he mentioned that:

    “I just tried the beta Web Developer Express with ASP.NET 2, and it looks like E&C may not be as important as it would first seem. I changed a line in the code behind, saved the file, and refreshed the page, and the new code was executed. I then danced with joy. I didn’t have to click stop! That is a frikkin miracle compared to what I endure numerous times each hour now with the around 90 second delay between clicking stop and getting back to where I was. So, if session state and all that other nice ASP stuff can be held in memory after a code change, and I don’t have to click stop, I will surely be able to cope without E&C in ASP.NET. I will be happy. ”

  56. cwillis says:

    Thanks for the follow-up. Regarding E&C for ASP – I think it boils down to the amount of time it takes to get back to business after a code change.

    Not clicking Stop is very very nice indeed, but if this delay can be kept to a few seconds (< 5), and session and application state can be held, then I would guess you might not need E&C at all for ASP.NET. I did see a small delay in changing code under Web Developer Express in the code behind, but when I changed something in a separate DLL in the ‘Code’ folder, it took about 30 seconds. Hopefully that can improve under the final 2005 version.

  57. axel says:

    This is great! Are there public changes in the compiler or assembly API to make E&C happen? E.g. I would assume that the same infrastructure you need for E&C would really help people to develop dynamic expression evaluators that can keep context.

  58. MBA says:

    Helpful For MBA Fans.

  59. DotNetAnders says:

    From Somasegars weblog:

    Someone has finally taken to their senses and introduced edit and

    continue…

  60. dee says:

    is der any1 hu cud help me to edit the value in a class after type a comand in a console application c#………tnx

  61. Off topic, but similar

    BTW, does anyone know how to use devStudio 2005 but with .net 1.1?  I tried using MSBuild and MSBee, but this is still problematic.  

  62. submitsim says:

    Hello everybody

    I am using c#.

    I want to know to programatically change my C# code in order to get it compiled by distcc.

    does any body know how to use distcc with c# sample program ?

    or maybe how to change the compiler in C# and use the distcc instead.

    please help.

  63. One goal of this site is to provide customers with insight into how we build software.