Did you know that you can train yourself for what’s new in Visual Studio 2010 and C# 4.0 (also VB) ?
The Microsoft Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview is available for more than a week now and it includes lots of slide decks, demos and labs covering the following topics:
- Whats New In the .NET Framework 4
- Whats New In Visual Studio 2010
- Video: Downloading And Installing Visual Studio 2010 Beta 2
- Demo: Hello Visual Studio 2010
- Common Language Runtime
- Demo: System.Threading.Barrier Demo
- Demo: System.Threading.CountdownEvent
- Managed Languages
- What's New In C# 4 and Visual Basic 10
- Video: Fixing PIA Pains with Type Equivalence
- Demo: Managed Languages 10-in-1
- Lab: Introduction To F#
- Lab: Visual Studio 2010: Office Programmability
- Lab: Visual Studio 2010: Test Driven Development
- ASP.NET 4
- Introduction to ASP.NET MVC
- Whats New In ASP.NET AJAX 4
- Whats New In ASP.NET Web Forms 4
- Web Deployment with Visual Studio 2010
- Video: Simplifying Data-Driven Web Applications
- Demo: AdventureWorks using AJAX
- Demo: ASP.NET AJAX 10-in-1
- Lab: ASP.NET AJAX
- Lab: Building an Web Application
- Lab: Enhancing a Web Application
- Lab: Introduction to ASP.NET Web Forms 4.0
- Lab: Web Development in Visual Studio 2010
- Windows
- What's New in Windows Presentation Foundation 4
- Lab: Building a Data-Driven Master/Detail Business Form in WPF using Visual Studio 2010
- Lab: Taskbar - MFC
- Lab: Gestures - MFC
- Lab: Multitouch - MFC
- Lab: Ribbon – MFC
- Windows Workflow
- Workflow 4: A First Look
- Video: Workflow Web Services
- Lab: Introduction to Workflow 4.0
- Lab: WCF Service Discovery using .NET Framework 4.0
- Windows Communication Foundation
- Lab: WCF Service Discovery using .NET Framework 4.0
- Silverlight
- Introduction to .NET RIA Services
- Data Access
- Whats New In Entity Framework 4
- Whats New In ADONET Data Services 1.5
- Introduction to Project "Velocity"
- Video: Server-Driven Paging with ADO.NET Data Services
- Demo: Project Velocity
- Lab: Introduction to ADO.NET Data Services
- Lab: Introduction To Project "Velocity"
- Parallel Computing
- Parallel Computing for Managed Developers
- Demo: ContosoAutomotive Demo
- Demo: BabyNames
- Demo: Parallel.For Loop
- Demo: Parallel LINQ (PLINQ)
- Demo: System.Threading.Tasks
- Lab: Parallel Extensions: Building Multicore Applications with .NET
- Extensibility
- Introduction to the Managed Extensibility Framework
- Video: MEF Preview 7
- Demo: Demos for "Intro to Mef" Presentation
- Lab: Introduction To Managed Extensibility Framework
- Application Lifecycle Management
Download the Visual Studio 2010 and .NET Framework 4 Training Kit - October Preview
Channel 9 also hosting lots of VS 2010 & .NET 4.0 Training classes
This is the third post of what’s new in Visual Studio C# 4.0.
At the former posts we covered optional parameters, Named Parameters at this post we will cover C# Dynamics and ExpandoObject
dynamic & ExpendoObject
C# 1.0 introduced us to the managed world (based on Microsoft perception)
C# 2.0 brought us Genetic types.
C# 3.0 introduced us to new concept – LINQ
C# 4.0 highlight is all about Dynamic Types
Say for example that you have the need to create an object on the spot and use it in a local scope, without dynamic type you had to define a class and then create the object. you could do it at runtime using reflection emit, code dom etc…now its much simpler !
All you have to do it to create an object of the type dynamic and using a special builder called ExpandoObject you can now define your object on the fly and use it.
- class Program
- {
- static void Main(string[] args)
- {
- dynamic person = new ExpandoObject();
- person.Firstname="ohad";
- person.Lastname = "israeli";
- Console.WriteLine(person.Firstname);
- Console.WriteLine(person.Lastname);
- Console.ReadLine();
- }
- }
You may say… wow this is cool.. well wait and see some more cool stuff..
Now lets add to this example and say that you would like to add a functionality to this object, what about adding person.Fullname in order to join the first and last name of the person and return it back.
- class Program
- {
- static void Main(string[] args)
- {
- dynamic person = new ExpandoObject();
- person.Firstname="ohad";
- person.Lastname = "israeli";
- person.Fullname = new Func<string>(delegate() { return person.Firstname + " " + person.Lastname; });
- Console.WriteLine(person.Firstname);
- Console.WriteLine(person.Lastname);
- Console.WriteLine(person.Fullname());
- Console.ReadLine();
- }
- }
As you can see we can point the new object properties to lambda expressions such as Func<string> and define on the spot a function that will return the full name of the person.
Note that on line 12 you need to call the function and not use it as property – person.Fullname()
What will happen if you forget the () by the end of the function name ? (note the change on line 12)
- class Program
- {
- static void Main(string[] args)
- {
- dynamic person = new ExpandoObject();
- person.Firstname="ohad";
- person.Lastname = "israeli";
- person.Fullname = new Func<string>(delegate() { return person.Firstname + " " + person.Lastname; });
- Console.WriteLine(person.Firstname);
- Console.WriteLine(person.Lastname);
- Console.WriteLine(person.Fullname);
- Console.ReadLine();
- }
- }
The result will be the lambda expression itself instead of the result of the lamba expression:
ohad
israeli
System.Func`1[System.String]
You can also add methods and not just functions using the Action expression: (note line 9)
- class Program
- {
- static void Main(string[] args)
- {
- dynamic person = new ExpandoObject();
- person.Firstname="ohad";
- person.Lastname = "israeli";
- person.Fullname = new Func<string>(delegate() { return person.Firstname + " " + person.Lastname; });
- person.CallOhad = new Action(() => { Console.WriteLine("Hi Ohad are you there ?"); });
- Console.WriteLine(person.Firstname);
- Console.WriteLine(person.Lastname);
- Console.WriteLine(person.Fullname());
-
- person.CallOhad();
- Console.ReadLine();
- }
- }
In conclusion dynamic types are cool but and there is a big but !
They are hard to debug and some of their functionality is only being tested at runtime this is why it is very important that whenever you use dynamic types test, test, and do some more testing using unit test of your code.
If you follow the following code you will notice that each of the calls to the properties in lines 11,12,13 begins with a small letter instead of uppercase. This code will compile without any errors but of course the code will fail at runtime as the properties / function names are all uppercase.
- class Program
- {
- static void Main(string[] args)
- {
- dynamic person = new ExpandoObject();
- person.Firstname="ohad";
- person.Lastname = "israeli";
- person.Fullname = new Func<string>(delegate() { return person.Firstname + " " + person.Lastname; });
- person.CallOhad = new Action(() => { Console.WriteLine("Hi Ohad are you there ?"); });
- Console.WriteLine(person.firstname);
- Console.WriteLine(person.lastname);
- Console.WriteLine(person.fullname());
-
- person.CallOhad();
- Console.ReadLine();
- }
- }
This is the second post of what’s new in Visual Studio C# 4.0.
At the former post we reviewed the feature of optional parameters at this post we will concentrate on Named Parameters.
Named Parameters
Lets assume you are writing the following procedure :
- public static void SaySomething(string name, string msg)
- {
- Console.WriteLine(string.Format("Hi {0} !\n{1}", name,msg));
- }
When you want to call it from your code you are using something like:
Code Snippet
- static void Main(string[] args)
- {
- SaySomething("Ohad","What's up?");
- Console.ReadLine();
- }
What’s the problem ?
Although you will have intellisense while you are coding it for the reader of the code its unclear what is the first parameter and what is the second parameter.
This is where Named Parameters gets into the picture. Using named parameter the code becomes much more readable to one who haven’t wrote it.
Code Snippet
- class Program
- {
- static void Main(string[] args)
- {
- SaySomething(name: "Ohad", msg: "What's up?");
- Console.ReadLine();
- }
- public static void SaySomething(string name, string msg)
- {
- Console.WriteLine(string.Format("Hi {0} !\n{1}", name,msg));
- }
- }
Named parameters are specially useful whenever you have multiple optional parameters of the same type. Without using named parameter how would the compiler know if the parameter which is being passed by line 5 is the name or the message.
Code Snippet
- class Program
- {
- static void Main(string[] args)
- {
- SaySomething(name: "Ohad");
- Console.ReadLine();
- }
- public static void SaySomething(string name = "Tirza", string msg = "Hi There")
- {
- Console.WriteLine(string.Format("Hi {0} !\n{1}", name,msg));
- }
- }
This is the first blog from a series of blog post which I'm planning to do on whet’s new in Visual C# 4.0
Optional parameters
Optional parameters is a new feature in C# 4.0 which will let you set a default value for an argument of a method. In case that the collie of the method will omit the argument the default value will take its place.
So instead of writing the following code:
- class Program
- {
- static void Main(string[] args)
- {
- SaySomething();
- SaySomething("Ohad");
- Console.ReadLine();
- }
- public static void SaySomething()
- {
- Console.WriteLine("Hi !");
- }
- public static void SaySomething(string name)
- {
- Console.WriteLine(string.Format("Hi {0}!",name));
- }
- }
You will only have to write:
- class Program
- {
- static void Main(string[] args)
- {
- SaySomething();
- SaySomething("Ohad");
- Console.ReadLine();
- }
- public static void SaySomething(string name = "")
- {
- Console.WriteLine(string.Format("Hi {0}!",name));
- }
- }
The statement name = “” at line 11 does the trick of the optional parameter with passing and empty string as the optional parameter.
Note that some of the reader of this post my think that its better to use string.Empty instead of double quote “” as it normally do but :
Code Snippet
- class Program
- {
- static void Main(string[] args)
- {
- SaySomething();
- SaySomething("Ohad");
- Console.ReadLine();
- }
- public static void SaySomething(string name = string.Empty)
- {
- Console.WriteLine(string.Format("Hi {0}!",name));
- }
- }
using string,Empty will result with a compilation error:
“Default parameter value for 'name' must be a compile-time constant”
And as it string.Empty is not a literal.
As for today you can download Visual Studio 2010 Beta 2 even if you don’t have access to MSDN.
Just follow the links below and download your favorite version.
Visual Studio
Visual Studio Extensibility
.NET Framework
Team Foundation Server
Test Products
Express
Visual Studio 2010 & .NET Framework 4 Training Kit

The October preview of the Visual Studio 2010 & .NET Framework 4 Training Kit which has content that had been tested with Beta 2 is ready for download.
Download: Visual Studio 2010 and .NET Framework 4 Training Kit
Training Course on Channel 9

Channel 9 launches an online learning center that will play host to developer focused training courses created by developers for developers. The videos and labs, with links to extensive training kits, will get you started on hands-on-learning with VS 2010 & .NET 4.0.
Browse: Visual Studio 2010 and .NET Framework 4 Training Course
How to Download and Install Visual Studio 2010 Beta 2

In this episode of 10-4, Brian Keller takes us through downloading and installing Visual Studio 2010 Ultimate Beta 2 and Visual Studio 2010 Team Foundation Server Beta 2. This time-compressed video will take you through all of the key things you need to know to get up and running quickly with beta 2.
Watch: Brian’s 10-4 Episode on Channel9
One of the big new features for the C++ world in VS 2010 is "native multi-targeting".
This means that an MSBuild-based VC project can be built against any set of tools (compilers, linkers, headers, libs, etc).
VS 2010 ships with support for targeting either the 2010 toolchain or the 2008 toolchain. But the design allows you to target just about any version - and still load and work with it in the VS 2010 IDE.
Take the attached file that I’ve prepared and open it inside:
%PROGRAMFILES%\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\
And now you will now be able to target to v80 (vs2005) and not just to v90 (vs2008) or v100 (vs2010)

Microsoft just published collection of walkthroughs for Visual Studio 2010 Beta 2.
The walkthroughs provide step-by-step instructions for common scenarios in the areas of:
- SharePoint Development
- Silverlight and WPF Data Binding
- Core Coding Experience
- Native Development
- Parallel Computing
- Visual Studio Extensibility
- Office Development
- Workflow Foundation
Check it out over here
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
.jpg)
Finally its here !
“Microsoft announces the second Visual Studio 2010 beta and .NET Framework 4 beta two have been released to MSDN subscribers with everyone else getting code on October 21”
“Microsoft will announce Visual Studio 2010 will officially launch on March 22, 2010”
“New features include Windows 7 and SharePoint 2010 tools, drag-and-drop bindings with Silverlight and Windows Presentation Foundation, the inclusion of the Dynamic Language Runtime (DLR) for programming with scripting languages, and support for parallel programming.”
http://www.theregister.co.uk/2009/10/19/visual_studio_2010_second_beta_packaging/
Its live on MSDN !

Yesterday we had the first Israeli Developer Community Conference and what a conference it was… The conference which is all about community work, sessions, topics, speakers, organizers managed to get close to 400 developers whom enjoyed sessions by:
Udi Dahan
Alon Fliess
Oren Eini (Ayenda)
Noam King
Ariel Ben Horesh
Dan Amiga
Roy Osherove
Sasha Goldshtein
Shlomo Goldberg
Ariel Raunstien
Some of the sessions were fully packed and people haven't been able to enter them, this is exactly why we decided to record the sessions and the recordings will be available hopefully by the end of the week at the IDCC conference site: www.idcc.co.il (The sessions were delivered in Hebrew)
We did learned from the conference about the preference of the audience, more and more people were interested in pure architecture sessions, sessions like:
Reliability, Availability, and Scalability – How to have your cake, and eat it too
Building Scalable Systems
Beautiful teams and code leaders
but on the other hand… sessions on the latest technologies got also the focus, sessions like What's new in C# 4.0
This really makes me wonder why we had less participant in ALT.NET Israel as ALT.NET Israel did had a focus on pure architecture issues and less on the latest technologies.
We will take it under consideration for the next conference as the community conference is truly about delivering the sessions that community would like to hear about.
Following are some pictures from the conference taken by Guy Burstein:

Ken Egosi & Ohad Israeli – The conference organizers



More Posts
Next page »