February 2007 - Posts
The download page of the CTP notes many improvements to technologies I've been playing with: C# 3.0, LINQ, ADO.Net Entity Framework and Windows Workflow Foundation:
The highlights of this CTP include:
- LINQ
The LINQ Project: this CTP represents a major milestone in the LINQ project.
- C# 3.0 Language Support: This CTP implements all of the C#3.0 language features from the May LINQ CTP including:
- Object and Collection Initializers
- Local Variable Type Inference and Anonymous Types
- Lambdas bound to Delegates and Expression trees
- Complete design-time support: Intellisense, Formatting, Colorization
- LINQ to ADO.NET
- ADO.NET is fully integrated with LINQ and offers many options for using LINQ in various scenarios: LINQ to SQL provides direct access to database tables from the programming environment, LINQ to Entities enables developers to use LINQ over EDM models, and LINQ to DataSet allows the full expressivity of LINQ to be used over DataSets.
- LINQ to Entities enables developers to program against a relational database using a view of the data that is appropriate for the application they are building, independent of the structure of the underlying database. The use of the Entity Data Model (EDM) enables developers to design models that follow the concepts built into the application, instead of having to map them to constructs available in relational stores. LINQ to Entities is built on the ADO.NET Provider model and will support working against different back end relational stores in addition to Microsoft SQL Server. This CTP includes a LINQ to Entities provider for SQL Server and SQL Server Compact Edition.
- LINQ to SQL (previous name DLinq) has enhanced the functionality from the May 2006 LINQ CTP. You can find it in System.Data.Linq namespace in System.Data.Linq.dll. New in this release is that DataContext provides optimized modes for read-only use and serialization . Also new is that DataShape streamlines eager loading capabilities and adds the ability to set queries on relationships
- LINQ To SQL Designer
- Methods can be created from stored procedures and functions within the designer.
- Better handling of database schemas.
- Improved inheritance support in the designer.
- LINQ over XML (XLinq)
- System.Xml Bridge Classes added – There is a set of extension methods allowing XPath / XSLT to be used over LINQ to XML trees, allow XSLT transformations to produce an LINQ to XML tree, and to validate an XElement tree against an XML Schema.
- Event Model - This allows LINQ to XML trees to be efficiently synchronized with a GUI, e.g. a Windows Presentation Foundation application
- Class hierarchy changes - XObject class added, XStreamingElement class (temporarily) removed
- Various understandability / usability improvements – There have been a number of relatively minor changes done in response to internal reviews, usability studies, and external feedback to make the API more clean and consistent.
- LINQ to Objects API
- The LINQ to Objects API supports queries over any .NET collection, such as arrays and Generic Lists. This API is defined in the System.Linq namespaces inside System.Core.dll.
- ADO.NET
- Extended, more powerful data APIs with the ADO.NET Entity Framework
- With the ADO.NET Entity Framework developers will be able to model the view of the data that is appropriate for each one of the applications they are building, independently of the structure of the data in the underlying database. The use of the Entity Data Model (EDM) enables developers to design models that follow the concepts built into the application, instead of having to map them to constructs available in relational stores. Once the model is in place, the powerful ADO.NET Entity Framework API is used to access and manipulate the data as .NET classes or as rows and columns, whatever is appropriate for each application.
- Added paging and stored procedures for update (“update customization”) for ADO.NET Entity Framework:
- Paging: the paging support in the ADO.NET Entity Framework allows developers to “page” over data in a database by indicating the start row and number of rows to be included in the result. Paging is available through Entity SQL (using the LIMIT AND SKIP keywords) and through the query-builder methods in the ObjectQuery <T> class (Top and Skip). In a future CTP the feature will also be enabled to be used in LINQ queries by means of the standard Take and Skip LINQ operators.
- Stored-procedures for update customization: the Entity Framework by default automatically generates SQL statements for insert, update and delete operations when processing changes to entities in memory to be sent to the database. With the stored-procedures update customization feature developers have the option to override the automatic SQL generation and instead provide stored-procedures that will perform the insert, update and delete operations, which the system will call during entity change processing. Among other things, this enables scenarios where direct access to tables is restricted in the database and the only way to make changes to the data is through stored-procedures.
- C# Workflow Rules
- Workflow Rules allows users to enter rules (and conditions) in a code-like manner
- Support the use of the new C# Extension methods features in their rules
- Enable operator overloading and the new operators in their rules
I am currently downloading the CTP, and will probably publish some of my first impressions soon.
Stay tuned...
The patterns and practices team have released thier first Weekly Drop of the Smart Client Software Factory - what appears to be the next generation.
In this drop, you have the first look at:
- New Application Blocks. Four application blocks that were previously available as part of the Mobile Client Software Factory were ported over:
- Disconnected Agent Application Block. This application block provides management features for execution of Web services from occasionally connected smart clients. With a disconnected service agent, the device can maintain a queue of Web service requests when offline (disconnected) and then replay them when a connection to the server application becomes available.
- Connection Monitor Application Block. This application block monitors and exposes the available connections and the associated networks.
- Endpoint Catalog Application Block. This application block provides features to expose the physical addresses and other details of remote services.
- Data Access Application Block. This application block provides support for SQL Server Compact Edition. This application block will be replaced when the factory migrates to the next version of Enterprise Library.
- QuickStart. This drop includes a QuickStart to demonstrate use of the Disconnected Agent Application Block.
In later drops, there are also plans for integration with Enterprise Library 3.0.
Stay tuned...
Today I wanted to deploy an application to the local web server (IIS 7.0) running on my Windows Vista. Using the publish wizard I received this error:
Failed to connect to 'http://localhost/ClickOnce_Hello/' with the following error: Unable to open the Web 'http://localhost/ClickOnce_Hello/'. To access local IIS Web sites, you must install all of the following Windows components:
Internet Information Services
IIS 6 Metabase and IIS 6 Configuration Compatibility
ASP.NET
In addition, you must run Visual Studio in the context of an administrator account. By default, Windows runs applications in a limited-privilege user account even when you are logged on to the computer as an administrator. To run Visual Studio with administrative privileges, right-click the Visual Studio icon and then click 'Run as administrator'.
I had Internet Information Services installed (IIS 7), and I couldn't find anywhere about "IIS 6 Metabase and IIS 6 Configuration Compatibility". I checked for these option in the IIS manager, but - nothing.
Finally I came accross this solution:
In order to enable IIS Metabase and IIS 6 configuration compatibility option for IIS 7 on Vista, go to the Control Panel, choose Programs -> Turn Windows features on or off. Locate the Internet Information Services and expand it, expand Web Management Tools, and then expand IIS 6 Management Compatibility. Click to select the IIS Metabase and IIS 6 configuration compatibility check box, and then click OK.
After doing so, you still have to run Visual Studio as an administrator, or turn off the User Access Control.
Enjoy!
The .NET Framework 3.0 training kit for WF, WCF, and CardSpace includes a set of hands-on-labs, demos, and presentations. The content was originally designed as part of the Windows Server Ascend training and has been used several times for training classes. Consequently, the content is organized into a four day agenda. You can also browse this content by technology.
To use the training kit:
- Download the training kit.
- Run the downloaded application to extract the files to your local machine.
- View the additional setup steps on the default page in the training kit. This page should be displayed automatically after extracting the files.
Note: If you do not use the default path when extracting the files, then some of the demos will need to be changed to utilize the new path.
Enjoy!
The ADO.Net team has published a series of posts about the Entity Data Model (EDM) which is part of the ADO.Net Entity Framework.
Part one describes the declarations of entity and association types in conceptual schema definition language (CSDL).
Part two is more specific about where instances of those types are stored, distinguishes entity and association types from instances of those types, and more.
Future posts in this series will be updated in this post.
Enjoy!
I was going to submit an abstract for an article in MSDN later this week about Windows Workflow Foundation Tracking Service I showed in my presentation last week. Unfortunately, two new articles about it were published today... So I better come up with other ideas for articles…
In the meantime, here are the links to the new articles:
Tracking Services Introduction
Tracking Services Deep Dive
Enjoy!
Since I eventually want to expose my new site to the internet, and allow users to use it whether they are registered users or just guests, I have to configure WSS to use Form Based Authentication instead of the default authentication using Active Directory.
I found a great article about it, and I am going to try it out.
After doing it, I plan to download and use a new Forms authentication Feature by Chandima, that includes Captcha on the New User web part.
ביום רביעי האחרון הרצאתי ב- Microsoft Developers Academy וההתרגשות הייתה גדולה מאד. למעשה זו הפעם הראשונה שאני משתתף כמרצה בכנס כזה ולכן המעמד, יחד עם האופי הפרפקציוניסטי שלי, הביאו אותי להשקיע את החודש וחצי האחרונים בלימוד להרצאה, הכנת הדגמות, ושעות אין ספור של חזרות.
אין ספק שכל רגע שהשקעתי היה שווה! מלבד התגובות הטובות שקיבלתי על ההרצאה, זו הרגשה מיוחדת לעמוד מול מאות אנשים ולהעביר את ההתלהבות שיש לי מהטכנולוגיה שאני מדבר עליה. לשמוע
תגובות כמו: "כל זמן ההרצאה חשבתי על מתי אני חוזר למשרד, זורק קוד של חצי שנה לפח ומיישם אותו מחדש באמצעות WF" או "אני תמיד נהנה בהרצאות של גיא ב. מסביר הכל לאט לאט עם דוגמאות מעולות כך שבהחלט יצאתי "חכם יותר" מההרצאה" - תמיד עושות טוב על הלב. תודה לכל נותני הפידבקים!
אז עכשיו נשארתי עם חיוך על השפתיים, הרבה סיפוק בלב ועם מחשבות על הפסגה הבאה שאכבוש...
וכמובן... קצת זמן פנוי...
Yesterday was a very exiting day for me. It was the first time I gave a talk in a Microsoft developers event, and it really meant a lot to me. I had put a lot of effort into this talk (creating the presentation, creating the demos and stuff), and it was all worth it. People had an interesting time, the atmosphere was great, and due the high demand, instead of repeating this session one more time, I repeated it twice! Many people came to me after the presentation to tell that is was great. I got back home very satisfied and looking forward to my next talk…
I would like to receive any comments you may have about the talk, the presentation and the demos. And Of course, if you have any questions about them or regarding WF, I would love to help.

I will go over the main issues of the talk here in this post for those who couldn't come or for those who had forgotten something, but let me remind you that the recordings of the presentation should be on-line in about 2-3 weeks.
Long running Processes
It is impossible to create a long running process within a scope of one method, and it is also not scalable and robust. We talked about the persistence service, and about how easy it is to create long running workflows using WF.
Providing Transparency
All those places in your business logic code where you log data, do not provide you with flexibility of changing the definition of the data you log while your system is running. We talked about the tracking service, and how you can change your tracking profile to get the data you want.
Workflow Rules!
Using rules and conditions lets you turn a very complex business login into a very flexible point in your application. No matter how complex it is, you business process is still readable and easy to follow. We talked about conditions activities (If-Else, While) and the PolicyActivity.
Dynamic Update
In order to respond for unforeseen events or circumstances, and change a single instance of a process, without the need of compiling and redeploying, we talk about Dynamic Update, and saw how much flexibility it can add to our systems.
Summary
WF is more than dragging activities from the toolbox into the designer, but it a new approach for building business processes.
The processes we build using WF are very easy to read and follow, no matter if it contains complex logic, or it is a long running process. As they say, "A picture's worth more than 1000 words!" (or lines of code, in my case…)
Finally we can focus on the business logic only, and leave all the extra components to be added as runtime services.
WF not only let you deal with daily problems more easily, and make you very productive, It is also a very interesting technology to use, and also very fun.
I encourage everyone that has no experience with WF to download , install what is necessary and play with the technology, and encourage people who already played a little with it to explore it more to ensure you take out the best of it, which is a lot!
Resources
Here are some resources to get you started:
WF MSDN Developer Center – Contains the list of MSDN articles from introductory level to advanced. I also contains the list of downloads and installations required for WF.
WF Community Site – Contains the WF Hands on Labs, many samples, custom activities and screen casts.
WF MSDN Forum – Where you can ask questions, and usually get response in a few minutes, due to its popularity.
Slide Decks and Demos
You can download my slide decks, and my demos (with all the stuff I hadn't have time to go over during the session). To make the demos run well, unzip them in to C:\WF\Demos directory.
For more slide decks and demos from the Microsoft Developers Academy, go here.
Enjoy!