RSS 2.0
 Wednesday, October 29, 2008

It must be hard to be a developer and not having heard about the Professional Developer Conference in Los Angeles. Yesterday and today were amazing and a lot of interesting stuff was announced and demonstrated:

Windows Azure - the operating system in the cloud. I like the links Steve Clayton has gathered http://blogs.msdn.com/stevecla01/archive/2008/10/28/an-azure-grab-bag.aspx

Live Mesh - a part of live services that can be used to store data and contacts in the cloud and to share them amongst your devices. https://developer.mesh-ctp.com/Welcome/default.aspx

Office Web Applications - Your favorite application web-enabled http://blogs.msdn.com/mikewalker/archive/2008/10/28/office-web-applications.aspx

And lots of more stuff like mounting .vhd files in Windows 7, creating great reports in VSTS2010, creating textual DSLs in Oslo, etc. If I would have to summarize it, it would be the photo below which I took during yesterday's keynote. This image underlines the Microsoft message of Software + Services again: You can choose whether you want your app (or parts of it) in the cloud or not.

DSC_2275_s

Wednesday, October 29, 2008 8:33:32 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [1] -
Development | Software Factories
 Friday, October 17, 2008

Now that you have installed Enterprise Library 4.0 and the source you are ready to play with EntLib to get to know the application blocks and corresponding configuration.

Let's start by creating a console application: Start Visual Studio 2008, click File | New Project, select C# console application, enter a name and click OK.

Your first step is to add references to the EntLib dlls. Right-click References, select Add Reference and select the following files:

  • Enterprise Library Data Access Application Block (Microsoft.Practices.EnterpriseLibrary.Data.dll)
  • Enterprise Library Exception Handling Application Block (Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll)
  • Enterprise Library Logging Application Block (Microsoft.Practices.EnterpriseLibrary.Logging.dll)
  • Enterprise Library Shared Library (Microsoft.Practices.EnterpriseLibrary.Common.dll)

Add the following using statements to the top of your program.cs.

using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
using Microsoft.Practices.EnterpriseLibrary.Logging;

 

First we are going to get data from a database. To do this, we need a database to get data from. In this scenario I am using the Northwind sample database. We like to perform data access using stored procedures and for that I created the following procedure:

USE [Northwind]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[SelectCustomers] 
AS
SELECT Customers.CustomerID, Customers.CompanyName, Customers.City
FROM Customers

Next go back to your program.cs and in your main method enter:

Database database = DatabaseFactory.CreateDatabase("Northwind");
DataSet ds = database.ExecuteDataSet("SelectCustomers");

What you just did is create a new database object through a database factory and a create database method that takes the configured connectionstring as parameter.

To actually see the data, you can add the following:

int i = ds.Tables[0].Rows.Count;

foreach (DataRow dr in ds.Tables[0].Rows)
{
    Console.WriteLine(dr[1].ToString() + " - " + dr[2].ToString());
}

Console.ReadLine();

All you have to do now is create a configure Enterprise Library so that it knows where to find the Northwind database and how to access it. Add an app.config file to your solution and open it either by double clicking it or by opening it in the EntLib Configuration Editor.

If you only see an Enterprise Library Configuration node, right-click it and select New Application. On the application right-click and select New | Data Access Application Block. Expand the Data Access Application Block node, right-click the Connection Strings node and select New Connection String. Rename the new connection string to Northwind, which you used in code, and enter the following ConnectionString: Database=Northwind;Server=(local)\SQLEXPRESS;Integrated Security=SSPI. This string assumes that your database is called Northwind, you are using a local version of SQL Express and you connect to it using integrated security. Accept the default ProviderName and save the configuration.

Now in Visual Studio you can press F5 to run the application and see the result.

 DaTest1

To summarize you have created a console application that references Enterprise Library, uses configurable settings to connect to the database and performs data access in just 2 lines of code.

Next we will add code to handle exceptions and to log them.

Friday, October 17, 2008 7:54:34 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Development
 Thursday, October 16, 2008

In the last post I showed how to install Enterprise Library. Now let's see what the installation results are.

The installation folder (Default = C:\Program Files\Microsoft Enterprise Library 4.0 - May 2008) contains the following folders:

  • Bin - contains the binaries you can use in your application. This folder also contains the configuration editor EntLibConfig.exe, which you can use to create and edit configuration files for Enterprise Library.
  • Docs - contains the files for Visual Studio help.
  • Src - contains the installer file for the Enterprise Library source files.
  • Visual Studio Integration - contains binaries that make the configuration editor available in Visual Studio.

If you want to start building application using EntLib, you can add the approriate files from the bin folder to your application.

Let's see what is in the EntLib source. Double-click the msi, click next to install the source for both the application blocks as well as the quickstarts. This results in:

  • bin - contains the same as the bin folder above
  • Blocks - contains a solution that houses all 42 Enterprise Library projects, see image below. There is also a second solution that additionally contains unit test projects and the actual unit tests to verify correct working of Enterprise Library as you change it. This is a great value that allows you to feel comfortable editing this pile of code while being able to prove you have not broken anything.
  • Lib - contains object builder and unity binaries that you can use in your application independent of EntLib.
  • Quick Starts - contains sample code in both C# and VB.NET that you can use to see available functionality of EntLib and how to use it in your own applications.
  • Scripts - contains batch files to amongst others compile EntLib from the source, register assemblies and to install Northwind database for the quick starts.
EntLibSln
Thursday, October 16, 2008 1:16:34 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Development
 Friday, October 10, 2008

Following the talk I did at SDC recently I thought about blogging about Enterprise Library.

A bit of history

Microsoft created a team called "Patterns & Practices" to help adoption of .NET in the developer community. This team did great early work on how to create secure, performing, n-tier applications. This work was mostly done on paper, whitepapers and downloadable pdf files, but nothing in code. So the P&P team started building a set of components, called application blocks, to perform data access incorporating Microsoft best practices. Next to the data access there were application blocks for exception handling, logging, user interface navigation, etc. These blocks would handle common application plumbing, allowing developers to focus on business functionality.

Avanade noticed the work Microsoft Patterns & Practices were doing in this field and heard feedback from the field that the blocks should be more uniformly and easier to use. Then Avanade created the first version of Avanade Connected Architectures (ACA), which was a very early version of Enterprise Library. Later Microsoft used ACA to create Enterprise Library themselves since they created the blocks in the first place.

Back to present

In May 2008 version 4 of Enterprise Library was released, containing many more features and advancements since the original application blocks were first bound together. EntLib adoption is very high in the community, especially when you see these numbers. Anyway, let's get started finding Enterprise Library on the web.

Downloading

When you want to get started using Enterprise Library, first you need to download the latest version or the one that matches your application version. In this post I am assuming that you are working with .NET Framework 3.5 and Visual Studio 2008. Click on the image below and you'll be redirected to the actual download page at microsoft.com.

EntLib

After registering you can download the msi. If you are running Windows Vista or Windows Server 2008 and have UAC enabled, you want to start the msi file through a command prompt that is running as administrator and enter: msiexec -i "Enterprise Library 4.0 - May 2008.msi".

EntLib1

Click Next, accept the license agreement, click next and another next.

EntLib2

After selecting the options (All) and install location (default) click next and then install. Enterprise Library will be installed on your machine. When the installation is finished it will prompt to ask if you want to install the source of Enterprise Library. You can uncheck the box and do that later (the source installer is located in [install location]\src).

Congratulations! You have just installed 9 application blocks that will make your life as a developer easier and save you a lot of time developing and testing "boring" plumbing code.

Downloads

Enterprise Library 4.0 – May 2008 (for .NET Framework 3.5 and Visual Studio 2008)

Discussion forum

Discussions for patterns & practices – Enterprise Library

Community

patterns & practices community site

Community Extensions

Enterprise Library Contrib

License

Microsoft Public License (Ms-PL)

Thursday, October 09, 2008 11:19:46 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Development | Software Factories
 Monday, September 29, 2008

Good news: Today Microsoft announced the next version of Visual Studio Team System, previously known as "Rosario", will be called VSTS 2010. Some good information can be found on in Somasegar's post and in the official press release. In short the message is that Application Lifecycle Management will be taken to the next level to better facilitate architects, testers and project managers, but also new audiences such as application maintenance people. I am sure you know that Microsoft are very open in developing new products and receiving feedback, so you can already enjoy an early "Rosario" build, which is downloadable as a VPC. A new version is expected shortly, which would make sense since the most interesting conferences of all is about to kick-off in 4 weeks...

Blog Bling 4

The Professional Developer Conference was last held in Los Angeles three years ago. Then Microsoft announced The LINQ Project, WinFX including workflow foundation and presentation foundation and the designer toolset we all know now as the Expression suite. This PDC is all about the cloud and Live, which sounds very promising.

Monday, September 29, 2008 6:24:13 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
ALM | Visual Studio | VSTS
 Saturday, September 20, 2008

Recently I ran into an error installing TFS2008 SP1. The environment is an upgraded TFS2005 install, had been running OK and updates went fine. This update just did not install.

Error 29106.Team Foundation Report Server Configuration: Access to the SQL Reporting Services databases could not be granted. Verify that the Team Foundation data-tier server has enough free disk space.

In the end the solution appeared in the log file, located in C:\WINDOWS\system32\config\systemprofile\Local Settings\Temp. The file stated

System.Data.SqlClient.SqlException: User, group, or role 'Domain\TFS_AT$' already exists in the current database.

The solution appeared to be to remove the computer account from logins and all databases in SQL Server on the Team Foundation Server Data Tier. After that SP1 created the account again and installed fine.

Saturday, September 20, 2008 7:53:29 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Team Foundation Server | TFS
 Wednesday, September 17, 2008

Wow, that were two impressive days. There are so many ways that partners are extending Visual Studio, it is really inspiring. My presentation was one of two about how to Extend TFS. The conference ended by a bunch of partners getting 4 minutes each to present their solution: T4 Editors, testing and performance tools, game factories, controls, etc.

Are you interesting in VSX, check out this site and this book, that was handed out at the conference.

Vsx

Wednesday, September 17, 2008 12:43:39 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Development | Visual Studio
 Monday, September 15, 2008

Today is the first day of the the Visual Studio Extensibility Developer Conference, about which I wrote some time ago.

There are some great sessions about Visual Studio, Shell, DSLs and VSTS, most of which are focused on product developers. This morning Rico Mariano, the Visual Studio Chief Architect, presented the kick off and talked about his pillars for the next Visual Studio versions. While Dev10 is underway, long term planning for Dev11 and Dev12 has already started. In general he said the teams will focus on Visual Studio being extensible (very relevant to this audience), scalable (Rico is a performance guy), modern, connected and frugal. The message was presented with some great anecdotes on the side from his years of experience on related teams since late 80s.

Each next version of Visual Studio should also be good looking, focused on a certain group of end users and obviously support the latest hardware and software.

VSX

Good stuff! Session decks are posted here

Monday, September 15, 2008 9:24:59 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0] -
Development | Visual Studio
Archive
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2009
Pieter de Bruin
Sign In
Statistics
Total Posts: 109
This Year: 0
This Month: 0
This Week: 0
Comments: 75
Themes
Pick a theme:
All Content © 2009, Pieter de Bruin
DasBlog theme 'Business' created by Christoph De Baene (delarou)