Category Archives: .NET

New Feature for C# in VS2013? Nope.

As one of my previous blog “The new features introduced in each version for C# (1.0 – 5.0)“, I promised that I will come back to this when VS2013 is released. This time I come with more information about them.

.NET Framework versions


There have been seven significant releases of the .NET Framework, excluding service packs. The framework includes the compilers, runtime, and libraries. Additionally, there are other profiles such Silverlight which complicate matters.
  • 1.0 – released in 2002
  • 1.1 – released in 2003
  • 2.0 – released in 2005, with a new CLR (to handle generics and nullable types) and compilers for C# 2 and VB 8.
  • 3.0 – released in 2006, this is just 2.0 plus new libraries: Windows Presentation Foundation, Windows Communication Foundation, Workflow Foundation, and Cardspace
  • 3.5 – released in 2007, this is 3.0 plus new libraries (primarily LINQ and some extra “base” libraries such as TimeZoneInfo) and new compilers (for C# 3 and VB 9)
  • 4 – released in 2010, this includes a new CLR (v4), new libraries, and the DLR (Dynamic Language Runtime)
  • 4.5 – released in 2012, this allows for WinRT development on Windows 8 as well as extra libraries – with much wider async APIs

C# language versions


There are five significant language versions:
  • C# 1
  • C# 2, introducing generics, nullable types, anonymous methods, iterator blocks and some other more minor features
  • C# 3, introducing implicit typing, object and collection initializers, anonymous types, automatic properties, lambda expressions, extension methods, query expressions and some other minor features
  • C# 4, introducing dynamic typing, optional parameters, named arguments, and generic variance
  • C# 5, introducing asynchronous functions, caller info attributes, and a tweak to foreach iteration variable capture

See the specifications page for downloads for each version, from Microsoft and ECMA.

Visual Studio versions


For a long time, releases of Visual Studio were closely tied to framework releases. The picture has become a bit more flexible and complicated, however:
  • VS.NET 2002 – support for C# 1 and .NET 1.0
  • VS.NET 2003 – support for C# 1 and .NET 1.1
  • VS 2005 – support for C# 2 and .NET 2.0, and .NET 3.0 with an extension
  • VS 2008 – support for C# 3 and .NET 2.0, 3.0 and 3.5 (multi-targeting)
  • VS 2010 – support for C# 4 and .NET 2.0, 3.0, 3.5 and 4
  • VS 2012 – support for C# 5 and .NET 2.0 to 4.5 (including WinRT on Windows 8), and portable class libraries

That’s all the theory. Here are the practical limitations and working configurations. Note that this assumes you want to use Visual Studio – if you’re happy to use just the command line compiler, that’s a slightly different story which I’ll avoid for simplicity’s sake. (At some point I’ll return to this page to talk about C# 4 and C# 5 features, but not just now…)
  • You can’t use C# 2 features without at least VS 2005
  • You can’t use C# 3 features without VS 2008
  • You can’t ask VS 2005 or VS 2008 to target .NET 1.0 or 1.1 (there’s an extension for it, but I haven’t used it – expect some pain for debugging etc)
  • You can’t force VS 2008 to restrict you to only C# 2 features, or force VS 2005 to restrict you to C# 1 features
  • Each version of Visual Studio has its own project file format and will upgrade your older projects when you first load them in that version. (The differences between VS 2003 and VS 2005 were significant; the differences between VS 2005 and VS 2008 are much smaller.)
  • VS 2008 has special support (in project properties) for which framework version you want to target: 2.0, 3.0 or 3.5
  • You can use most C# 3 features when targeting .NET 2.0 or 3.0, but not quite all

Evolution of C# in vs2013
Evolution of C# in vs2013


You may found that there is no update on C# in VS2013. Yes, this is correct.

From the MSDN Developer Blog,
No new C# and VB Language Features in VS 2013

From the MSDN Library
What’s New in Visual Studio 2013

You may also have a look on the MSDN page for more information
.NET Framework Versions and Dependencies

The new features introduced in each version for C# (1.0 – 5.0)

Last week I have a gathering with all current and ex-HK MVPs. During the dinner, we talked about what is the difference between each new version of C#. Please allow me to have a short summary of this topic into a picture. You are welcome to share this picture to your friends, your user group, your colleagues.

P.S. Noted that Microsoft has just announced that VS2013 will be coming soon, I will come back to this once it is Release or in Beta.


 


 

VS2012 Giveaway is not there this time

Since VS2005, all Developer MVPs has 3 giveaway on the VS subscription. Some MVPs were giving it to public, some MVPs were giving to friends, some MVPs were giving it to memebrs of their local community. However, this time there is no such giveaway when VS2012 launch. Why? I don’t know the reason. But I think, VS2012 which is targeting Win8 development and Microsoft should enourage developers to build apps to Microsoft Store. So I highly recommend tht MVP program could try to arrange this.

Visual Studio 11 Beta can be downloaded now.



Visual Studio 11 Beta is ready for you. Now you can download it from browsing http://www.microsoft.com/visualstudio/11/en-us/downloads and also can download from MSDN Subscriber Downloads . 


 


There are some compatibility with previous releases. I think the main points are,


  • .NET 4.5 is an in-place update of .NET 4
  • You can install and Use Visual Studio 11 Beta alongside Visual Studio 2010.

Also, there are some upgrade paths planned ready for Developer Preview / Beta / RC / RTM later on.


  • Supported:
    • Upgrade from .NET 4.5 Developer Preview to Beta
    • Upgrade from .NET 4.5 Beta to Release (RTM)
    • Upgrade from VS11 Beta & .NET 4.5 Beta to RC
    • Upgrade from VS 11 RC & .NET 4.5 RC to RTM
  • Not Supported
    • Upgrade from VS 11 Developer Preview to Beta
    • Upgrade from VS 11 Beta to RTM

Because the download available now is the Beta already. So the installation are ready for you to upgrade from Beta to RC only. You may have to uninstall it and install RC. But once RC is ready and after you installed RC. You could direct upgrade from RC to RTM.


 

MVC Performance in IIS – Part II

Last 2 weeks, I run MVC training kit to IIS 7.5 and was trying to figure out the baseline for the performance tuning for my project. I tested 3 Scenarios,


S1) Hosting MVC 1.0 Training Kit in Application under Default Website
S2) Hosting MVC 1.0 Training Kit in New Website with port 8081
S3) Hosting my company’s MVC Project in New Website with port 8082


And their result of max throughput on Default Page is around,


Result 1 Screen Shot
R1 Result Screen Shot

Result 2 Screen shot
R2 Result Screen Shot


R1) ~200/sec
R2) ~2980/sec
R3) ~410/sec


This time, I tested in more scenarios,


S4) Moving MVC 1.0 Training Kit to root of Default Website
S5) Hosting MVC 1.0 Training Kit in Application under New Website with port 8081
S6) Hosting my company’s MVC Project in Root of Default Website


And their result now are,


Result 4 Screen shot
R4 Result Screen Shot

Result 5 Screen Shot
R5 Result Screen Shot

Result 6 Screen shot
R6 Result Screen Shot


R4) ~225/sec
R5) ~2650/sec
R6) ~170/sec


OK, let me group the result in a table and so we could view all results more clear.


  In Root In Application
MVC 1.0 Kit in Default Website ~225/sec ~200/sec
MVC 1.0 Kit in New Website with port 8081 ~2980/sec ~2650/sec
Company MVC Project in Default Website n/a ~170/sec
Company MVC Project in New Website with port 8082 ~410/sec n/a


Now the results are showing that
1) The performance will be gained about 10% if you move the MVC project from Application under website into root of website.
2) The performance will be gained in a range from 240% – 1325%  if you move the MVC project from Default Webste to New Website.