- Melbourne Videos Live
-
In March I did the keynote for our Heroes Happen Here launch in Melbourne. While at the launch event I did a series of videos with builder au which are now live on the site:
On managing the developer team for Visual Studio:
http://www.builderau.com.au/video/soa/Tips-for-managing-smart-people/0,2000064338,22450377p,00.htm
All things LINQ:
http://www.builderau.com.au/video/soa/Eliminating-boilerplate-code-with-LINQ/0,2000064338,22450375p,00.htm
Designer vs developer:
http://www.builderau.com.au/video/soa/Visual-Studio-vs-Expression-Suite/0,2000064338,22450378p,00.htm
Non C# languages in .NET:
http://www.builderau.com.au/video/soa/What-s-doing-with-non-C-languages-in-NET-/0,2000064338,22450374p,00.htm
Added network functionality into VS08:
http://www.builderau.com.au/video/soa/Visual-Studio-2008-takes-to-the-tubes-/0,2000064338,22450376p,00.htm
Future of Visual Studio:
http://www.builderau.com.au/video/soa/Looking-into-Visual-Studio-s-future/0,2000064338,22450373p,00.htm
Thanks to Nigel Watson for setting everything up in Melbourne and forwarding the videos!
- Announcing Popfly Game Creator
-
My boys (11 and 13) *love* playing video games. I've also spent time trying to get them interested in authoring their own game software using Visual Studio. I once started writing a game with my son, showing him how to create a project, importing System.Drawing, then drawing a line. Next we changed the color. I was proud of transferring my vast knowledge to my prodigy as well as the high quality of my product.
His response? "Yeah, that's interesting, but where do we put Mario?"
<sigh>
For me as a kid with no training and no mentor, "inventing" a bubble sort algorithm was really awesome even though my mom seemed puzzled. But for my kids, what they really wanted was an easy way to get a game up and running. The code is something that would come next as they made their effort much more sophisticated.
Today we are announcing the new Game Creator for Popfly which allows precisely this. Game Creator is Silverlight based which means the games you create have vector graphic support and access to a ton of great media support. The result is really cool looking applications.
To make sure it really was easy, I brought my two sons Michael (13) and Eric (11) to Microsoft during their spring break to be beta testers. They had a blast working with Adam and Suzanne:
Each was able to create a game in two hours.
Michael's game concentrated on covering a breadth of features to see what it could do (and found a few bugs).
Eric's game is a side scroller ala Mario called JellyMan.
You can get going with the Game Creator on Popfly from the main page:
This will allow you to either find existing games you can play or modify, or create a new game.
In my case I opened the UFO Attack template. This brings up the designer:
You can now start to customize the game. For example, if you select Scenes you can change characters, behavior, decide what to do when you win or lose the game, etc:
As with all Popfly work, you can now save your own version of the game and share it with your friends. I think you'll find the environment is pretty addicting once you get going.
The top level goal for Popfly remains the same: make it super easy for anyone to start creating their own software they can share with their friends. There is an amazing amount you can accomplish without having to actually write code. When you decide you want to do something much more powerful, then you'll have the opportunity to start working with Visual Studio.
Congratulations to the Popfly team on the new release!
- VC++ 2008 Feature Pack Released Today
-
The VC++ 2008 Feature Pack, with a new version of MFC and an implementation of TRE1, has officially been released today! The download is free for for any VS2008 Standard or above customer and is a fully supported product. You can find the download here.
The key new features for MFC include the ability to achieve the look and feel of Office 2007 (Ribbon, Pearl, Quick Access Toolbar, Status Bar, etc), Office 2003, Visual Studio (docking, auto hide, property grids, MDI tabs, etc), IE, and Vista. In addition you'll find new Shell management classes which allow you to enumerate folders, drives & items, browse and more. This update provides a perfect opportunity to update your MFC application. You can find a detailed walk through for MFC here.
The TR1 implementation includes several important features including smart pointers, regular expression parsing, new containers such as tuple/array/etc, sophisticated random number generators, polymorphic function wrappers, etc. There is a lot to explore here and you can find a walk through here with more details.
Enjoy!
- Silverlight 2 Map / DataGrid Demo (Part 2)
-
In Part 1 we created a n-tier Silverlight application which used LINQ and Silverlight 2 including the new controls. That version takes a simple text box parameter for the state we want to look for. Now let's spruce it up a bit with a map component. The end result will look like this:
I've posted the source code for the full demo here. Hopefully you were able to create Part 1 without it. But you'll need the map markup to do the next step.
Once you have downloaded the code, copy the map in page.xaml into your project. After you reload the designer you'll see the USA map in the split pane view:
The xaml for the map is a Canvas and a large collection of <Path> items for each state. A Path is a set of points that bound a region. If you open page.xaml now in Expression you will be able to click on each Path item to see its name and location:
In this case I've selected Washington state which has the name Path_412. Because the Path has a x:Name, we can write code against it just our button. Navigate back to VS2008 and add the following code to the project:
Now when the user clicks anywhere inside the Path for Washington, our handler will get called allowing us to search for items in the database.
With a little more code we can also hook up hover effects to change the color as you move in/out of the state region:
As the mouse enters the Path for the state, its color is changed and vice versa. Now that you have the basic mechanisms, you could start hooking up all sorts of behavior. For example you could show the text name of the state, show the state flag, or even play a video bounded by the region. These are the sorts of features that really set apart Silverlight from normal HTML/AJAX applications.
The obvious next step in the demo is to create a table of the state and path objects and hook up the events in a more generic way. I've left this as an exercise to the user.
Hopefully these two tutorials have been useful for you, enjoy!
- Silverlight 2 Map / DataGrid Demo (Part 1)
-
I did the keynote speech for VS Live in San Francisco on 3/31 and included a demo of how to use the new Silverlight 2 features including the DataGrid. I wanted to write up the steps required to reproduce my demo for anyone that wants to build it themselves. The demo shows how to use VS 2008 with the Silverlight 2 plug-in, Expression 2.5 preview, LINQ to SQL, LINQ to XML, as well as the new controls. This post got longer than I expected, so I'm going to post another that shows how to use the Silverlight Airlines demo map to give a new twist for looking up data.
In this write up, I tried to consolidate a lot of different sources of good data (like ScottGu's blog, the "How Do I" series for Silverlight 2, and several other great examples of LINQ to SQL). If you are an advanced user, you may find I have included too many steps. But I thought for a lot of folks it would be easier if you could really follow along and wind up with a working application.
To get started, you'll want to download all of the required software I use in the walk through. It is all free:
- Silverlight 2 Beta Runtime and Tools (here)
- Windows Silverlight 2 runtime (here)
- Visual Studio 2008 plug-in (here)
- Silverlight 2 SDK Beta 1 (here)
- Expression Blend 2.5 Preview (here)
The application is a simple Silverlight 2 RIA that will call a web service for data which is filtered on the middle tier. The middle tier will in turn use LINQ to SQL to query my database (I'm using the Northwind database to make things simple).
The application is built in the following steps:
Step 1: Create the project with an ASP.NET backend and a Silverlight 2 front end
Step 2: Build a web service that can query the database and return an XML document with my data
Step 3: Create the Silverlight 2 client application that will invoke the web service and show data in a grid
Step 1: Create the Project
After you have installed the development environment, launch VS2008 and create the project. You will notice under both C# and VB.Net that the type 'Silverlight Application' has been added:
click OK after you have selected the project & language type. I have written my demo code in C#, but it you can easily write the application using VB.Net as well.
New for Silverlight 2 and VS2008, you can create either a test HTML page or you can create an entire web site solution with both a client and server piece. We're going to use that default option in our demo:
This will create both the server and client pieces:

At this point you could build and launch the application to ensure everything is installed correctly. It will be rather boring.
Step 2: Create the Data Layer
The client application is going to query for an XML Document which is generated using LINQ to SQL and LINQ to XML. To start, we'll generate the LINQ to SQL access to the Northwind database. Right click the ASP.NET project and select 'Add New Item', then select 'LINQ to SQL classes'. Name the new item NorthWind.dbml:
You will be prompted about organizing your code into proper folders, simply click 'Yes':
You will now get the LINQ to SQL designer view. This view allows you to drag tables to create schema mappings that are then accessible through LINQ. Change the view to Server Explorer and drag all of the Northwind tables onto the design surface. This will generate the schema mappings for you:
At this point you could declare the database context and start to write LINQ queries. For example:
The next step is to create our web service to return the data base to the client. You could create the web service in a lot of different ways including using WCF. In my case I'm going to do a really easy web service using asmx. Right click the ASP.NET project and do 'Add New Item'. Add a Web Service called NorthWind.asmx:
In the new file, add a new [WebMethod] called GetCustomersByState which takes a string filter. The base LINQ to SQL statement for getting the customers filtered by state is shown above. However for our method, we want to return an entire XML document to the client. We could go through and build up a document element at a time, but one of the coolest things about LINQ is the ability to combine two different types of data into one expression. In this case we will use LINQ to XML with LINQ to SQL embedded in the expression to create an entire document at once:
Let's break this one down a little bit as there is a lot going on here. The first few lines of the expression create the XML document, add the "1.0" utf header tag for the file, and then create an outer element: <customers></customers> to frame our list:
Notice that the XElement for "customers" doesn't actually terminate yet, the rest of the expression is passed in to the constructor to help create the contents of the document.
Next you will recognize the LINQ to SQL expression which retrieves the database records which match our filter criteria:
With the right records returned, we need to turn each into a <customer></customer> record instance. We'll do this by selecting each field into an element in the document:
Here again there is an outer element, "customer", which will take the fields into its constructor. Each inner element then takes a field from the query, such as c.CompanyName, and populates the record instance.
The result is the fully formed document with a list of customer records. This ability to mix XML and SQL in one expression is very powerful. I've written only 13 lines of code to do an entire database query + document creation (and 2 lines of code were terminated parens <g>).
At this point we have a working web service we can invoke from the client so we'll build that next.
Step 3: Build the Client
The client is going to use a Grid for basic layout, as well as a DataGrid to display our content. To build the client, right click on page.xaml and 'Open in Expression Blend...'. Start by making the Canvas larger so we have some room. You can do this by either dragging it larger in the designer, or by switching to XAML mode and editing the settings directly:
I've made the Width="1000" and Height="700" which fits a normal display when you are projecting to a screen. Next in Design mode, add a couple of rows into the grid by moving your cursor into the grid area and clicking. We'll create a skinny top row which will have the search box and button, and then leave room for a data grid. Make sure to leave most of the bottom open for the final step:
This will translate into XAML markup for the Grid that will look something like the following:
Now we need to place a TextBlock (aka a label), a TextBox (aka edit box), and a button into the pane row. You can do this using the control palette at the left side. Note that Expression does a good job of not cluttering the palette. So if you don't see what you want, you can search for it using the >> symbol as follows:
I find it is easy to select the control type and then drag an instance out in the grid row you want. This will automatically add the Grid.Row="0" property (or whatever row you place the control in). Change the Text property to "State:" for the prompt:
Now repeat the step for the TextBox. For this control, give it the name 'EditBoxState':
This will set the x:Name property for the control which means we can write managed code against it later. Finally add the button to the display:
If you are used to Windows Forms, you might spend some time searching for the Text property on the button. It doesn't exist in XAML. Instead you need to set the Content property to change the display text. Set the name to ButtonSearch and then change the Content property (under Miscellaneous property pane) to 'Search'.
At this point we have a navigation pane that will take input (the state name to filter on) and action (the button). Make sure to save all of your changes.
The next step is to add the data grid where we can display the data we retrieve from the server. Switch back over to VS2008. You'll be warned the XAML file contents have been changed, go ahead an reload the file.
Now open page.xaml in the VS designer. You'll see a set of controls in the Toolbox. This works just like Windows Forms and Web Forms. Find the data grid control and drag an instance into the XAML split pane view:
This will not only create an instance of the DataGrid, but it will also automatically add references to the correct assemblies to make it work. You'll need to now make a couple of edits to the control line to auto generate the columns and ensure the data grid is in the proper row:
You could do this kind of design work in Expression as well. In the markup I've also given the control a name, CustomerList, so we can write code against it.
At this point our first round of UI is done. But we need to hook up behavior. We'll do this by writing some client code in page.xaml.cs. First, do an Add Reference for System.Xml and System.Xml.Linq:
Notice that all of the assemblies are in the Silverlight 2.0 directory. These assemblies are designed to run against the Silverlight CLR and are logically a subset of the full .NET Framework assemblies. You'll need to add the using statements for both assemblies as well.
Now we need to add a reference back to our ASP.NET Web Service that we built in Step 2. We'll do this by doing an Add Service Reference:
On the dialog, click the Discover button which will query our project for any existing web services. Expand the list and choose the NorthWind service. Call it 'NorthWindService' and click OK.
Now let's write a helper method which will create an instance of the web service and invoke the filter method. We'll pass in our filter criteria which will eventually be used by LINQ to SQL to find the correct set of records:
This code is using the async pattern so we don't stall the UI while we make calls over http. We'll need to add some logic to figure out when the call is complete and process the data. Insert a new line of code as follows:
go ahead and hit tab twice to fill out a default Completed method.
We'll want a class we can use to hold the results. Using auto properties, you can create one quite easily in the current namespace:
Back in our Completed() method, we can parse the results into a set of CustomerInfo items. The results of the call (assuming no error) will be in the e.Result field. In our case we'll once again use LINQ to XML to parse apart the document we sent back from the server:
Like the server side code, this version parses the xml document looking for every <customer></customer> it can find. For each item found, it will pull the elements out and initialize them into a new instance of CustomerInfo.
Now that we have all of our data, we can tell the DataGrid to bind to that content and display it:
The DataGrid will now iterate over these items and display them. Because we had 'AutoGenerateColumns="True"' in our grid, it will automatically show our data for us in sizable columns. If you were at my keynote in San Francisco, this is the step I missed on stage which led to the data not displaying at first (gotta love those demo glitches).
When you are done, the final method should look like this:
Our final step is to actually hook up the Search button. To do this, add a Click handler for the button and pass the edit box text into our search helper:
Now build and run the application. Enter a state like 'OR' and hit Search:
Wahoo!
In my next post, we'll add the USA map into our bottom pane and make it possible for you to look up customer records by clicking on states directly in the display.
Enjoy!
- Lang.NET Videos Back Online
-
I had posted a pointer to our Lang.NET videos here, but unfortunately the site they were hosted on was overwhelmed by the interest. The videos have been re-posted to a more robust network and are ready for viewing again. Please accept our apologies for the time delay and initial failure. I hope you will enjoy the content...
- Announcing Silverlight Support for Nokia Devices Including S60
-
Part of my role as GM for Visual Studio is driving our Mobility efforts in the Developer Division (including Windows Mobile, .NET Compact Framework, and Silverlight). Today I'm happy to announce an agreement between Microsoft and Nokia to take Silverlight to a wide range of Nokia devices. You can read the official press release from Nokia here.
This is great news for developers. We've been working very hard to ensure that Silverlight makes it easy to write Rich Internet Applications (RIA) in a very consistent way across platforms. You've seen this in our demos running applications on both Mac OS and Windows. With this announcement you'll be able to bring your Silverlight application to a broad set of mobile devices as well.
The announcement today includes support for S60 on Symbian OS, as well as S40 devices and Nokia Internet tablets. As a developer that means we are making the platform available to hundreds of millions of devices which gives you great reach.
You'll continue to use Expression and Visual Studio to develop your applications. XAML works incredibly well for this and translates nicely to the device. Modulo things like screen size, you'll be able to use the same application resources as you use on the desktop.
I'm currently in Melbourne, Australia (I did the Launch keynote) but I'm headed to Las Vegas in a few hours for Mix'08 (you have to love a 16 hour flight where you take off Wednesday morning and land Wednesday morning<g>). Hopefully I will see you at Mix. There's a lot of great stuff happening this year and you should look forward to some very cool demos. See you there!
- Recommended Book: ADVANCED WINDOWS DEBUGGING
-

I just got this new book on advanced debugging in Windows by Mario Hewardt and Daniel Pravat. This book is right up my alley and gives an advanced tutorial on debugging in Windows using the Windows debugger (windbg, ntsd, and cdb). I covered similar topics a while back in this managed code debugging tutorial.
I highly recommend this book for anyone doing any advanced systems code kind of debugging. In particular Chapters 5 and 6 are great for understanding how to debug heap corruptions. In these chapters the authors go through the layout of a stack (with all calling conventions explained), as well as walking through the heap and diagnosing bad pointers.
If you are just writing managed code you should always be great using the Visual Studio debugger. But if you ever have to do any advanced work, this book is definitely for you.
- Visual Studio 2008 Launch Event in LA
-
Today we are formally launching Visual Studio 2008, Windows Server 2008, and SQL Server 2008 here in Los Angeles. The opening keynote featured Tom Brokaw (of NBC Nightly News fame) and Steve Ballmer.
The event is very well attended, to the point where we did not have sufficient room in our Developer Track. My apologies to those who wound up waiting or filing through the room in long lines :(
In my presentation we went through new user experiences with Expression and Visual studio both for the web and the client, the collaboration experience for designers and developers as well as project managers / devs / tests, and finally productivity including technologies like LINQ. There is a lot of cool stuff in this release so I hope you will try it out.
At the end of my presentation there were three links I wanted to share here as well:
- You can install trial versions of VS2008 here
- You can find more information about the .NET Framework at the developer center here
- Finally, you can find several Software + Services Blueprints on channel9 here
During the presentation an gentlemen asked about more resources on using ASP.NET AJAX with existing web sites. You can find a ton of data on www.asp.net, including the learn tab. There are also a lot of white papers available on this page.
Another person asked about performance of using LINQ to SQL. The LINQ provider will generate pretty decent default SQL to use for getting its data. Usually when I see perf issues it has more to do with custom queries you may have spent a significant amount of time crafting. Under these circumstances the best solution is to create a stored procedure and use that.
[Update] I've had a couple of folks ask where they can view some of the online material. You can watch webcasts of Tom Brokaw and Steve Ballmer from this site, along with some of the case studies.
If you are in LA I look forward to chatting with you. If you are going to the Melbourne event, I will see you next Tuesday <g>
- Lang.Net 2008 Videos Available
-
We held our second Lang.Net Symposium on campus at the end of January and the videos from the event are now online here. John Lam has a great summary of the event here.
I gave the opening keynote in the morning (sorry for the microphone issues, it kept popping during the talk).
I really like this conference for a couple of reasons: it is one of the only forums where 85% of the audience has actually written a compiler, and we had a good showing from multiple companies not just Microsoft.
Thanks to the dynamic languages team for creating and running the event!
- Download Install Challenges with VS2008
-
I've seen several folks having problems since we RTM'd VS2008. These usually manifest themselves as as things like "Download Manager - Error" when trying to access the bits (one example post).
Our release team and the MSDN team have been working to rectify these issues which have stemmed primarily from capacity problems on the edge network. Things should be working smoother now and updates to the Download Manager are also on their way as required to fix these problems.
I'm sorry if you have run into these problems. Obviously we'd like to see your experience be as smooth as possible. If you are still experience problems, please do let me know and we'll work to fix them ASAP. thanks!
- Couple of Historical Facts
-
At first when I started to see things I've worked on talked about in articles I thought it was pretty cool. And then I started to realize how much is taken down incorrectly. I'm sure it is hard to piece things together after the fact. Take this article.
A couple corrections:
- The CLR was actually built out of the COM+ team as an incubation starting in late 1996. At first we called it the "Component Object Runtime" or COR. That's why several of the unmanaged DLL methods and environment variables in the CLR start with the Cor prefix.
- There were several language projects underway at the start. The C++ and languages teams both had ideas (Cool was one of them), and in the CLR we wrote Simple Managed C or SMC (pronounced 'smack'). We actually wrote the original BCL in SMC. It was a leap of faith to convert to C#. At the time the IL instruction set was changing quite a bit and having our own compiler checked into the tree was very handy. In the end we wound up releasing the SMC compiler in the SDK as a sample.
Given how much work was done on the runtime, languages, and IDE, it was quite surprising things didn't leak by the time we did the formal product launch at PDC 2000 in Orlando. Since that time (thankfully) we've tried to be much more transparent with the products we are building.
- Visual Studio 2008 and .NET Framework 3.5 RTM!
-
Today we released to manufacturing Visual Studio 2008 and .NET Framework 3.5! I want to congratulate the division on this major accomplishment.
I've been building applications all along with VS 2008 and there are some very cool features. Some of my favorites include LINQ, XML Literals in VB.Net, and the advances in JavaScript development from intellisense to advanced debugging. There a hundreds of cool things to find in the product.
In addition to the product features, we introduced several changes to the way we built the product itself. We had tighter integration between PM/Dev/Test the entire way through (the Feature Crew model) which allowed us to get integrated builds much sooner and dogfood quicker. We worked out our x-team dependencies far sooner than ever before leading to a more predictable schedule. As Soma says in his blog, we drove this through the usage of TFS. But the lion share of the credit goes to the engineering teams for pushing hard on quality and community feedback early in the cycle. I've been working on .NET/VS since it started and this was the smoothest release we've had.
Please give it a try and let us know what you think. You can find everything you need to get started here. Enjoy!
- Tulsa Techfest 2007 Keynote Slides
-
This morning I gave the opening keynote for the Tulsa TECHFEST 2007 event. There is great attendance at the event and 16 tracks! As promised, I have made the slides available online for you to download:
- Slides are here
- I've blogged information on getting started with Silverlight here
At the event about 40% of the group had already downloaded Visual Studio Beta 2.
I also gave a demo of the latest version of Popfly, now in open beta (way to go team!).
If you are attending TECHFEST I look forward to meeting you (Oktoberfest this evening?). Don't be shy!
- Getting Started With Silverlight
-
I've had a number of queries on how to get started with Silverlight after my talk in NYC on Monday. The best place to get going is the www.silverlight.net site. There is a wealth of information up there including partner show cases, downloads for the software (runtime and tools), samples, etc.
If you want to play with the show cases, start on the main site and click the "See More..." link:
This will give you the full show case:
You can select any item (like the Fantastic Four or Halo HD vidoes) then click the "See It" button to activet he content.
The next place to go is the "GET STARTED" link on the top of the page which gives you step by step instructions for downloading all of the software I showed (runtime, VS add-on, preview Expression, etc):
Finally there are a ton of code samples you can download under the "LEARN" and "COMMUNITY" links at the top of the page. You can build up a lot of experience with just these steps. We also have a great deal of material out there in blogs.
Enjoy!