Mike's Blog


Business Intelligence keeps me live and communicating!

November 2006 - Posts

TFS Check-In Policies Pack

There was a recent TFS Version Control Blog post which asked the community for feedback regarding TFS Version Control Check-In policies. The feedback questions were as follows:

  1. Would you like us to release a check-in policy pack together with some best practices and ship that out of band?
  2. If we do decide to do this then the next question becomes which policies are customers writing themselves that we can standardize and put in the pack?
  3. Which policies would customers like to see as examples?

The TFS Version Control Blog is ran by Mario Rodriguez who is a program manager on TFS Version Control. A couple of weeks ago he announced a small release-out of band- of new check in policies. The pack will contain four policies and they will also distribute the source code so you can use it as a reference.

Check-in policy granularity: there is one already in Code Gallery and what we will do is package this, change some of the UI and take out some of the complexity

Work-Item Associations: This is a very cool one that I hope many of you will find useful. You get to specify a query and if the associated work items by the developer are not part of the query results the check-in is blocked. This is very useful when it comes to making sure that check-ins are always associated with approved bugs.

Banned files: this policy allows you to specify a file extension or a regular expression in order to keep files that you don’t want out of version control. This is usually used for dll’s, build artifacts, or some website files that are automatically generated.

Check-in Comments: this policy gets shipped as part of the SDK. It looks at the check-in comments and makes sure it is not blank.

Some other cool Check-In policies already on the market are, not in any particular order:

Check for Comments: same as Check-in Comments.

Time That Task: gathers hours worked on a task during each check-in. This policy requires check-in to be associated with only one task that is in an "Active" status. It also gathers the number of hours worked on the associated task incrementing the completed hours and decrementing the remaining hours.

Code Review Workflow: doesn’t allow a check-in unless it has an associated Code Review work item (is included too), and that work item is set to approved. Only people in a TFS group named {Project}\Code Reviewers can set an item to approved.

Build Status: gets the last build status and validates a particular build type was actually passing before you check-in. 

Custom Path: a mechanism that allows you to specify the source control path(s) that a particular policy is allowed to act on. This will allow for example a single Team Project to have one set of Code Analysis rules for a particular folder and completely different set of rules for another folder.

Summary
As you can see there are some great Check-In policies available. All of them are open source and I'll hope they soon will release this pack too on connect or codeplex.

Building my own UserControl WebPart part V

In mine last post about my own UserControl WebPart, I ended the article with creating a simple editor part. The only thing I didn't show, was how you really could use an editor part to personalize / customize its WebPart. In this article I will show the code and than explain why I coded it this way. So here is the code of the WebPartEditor, which gives a list of all available user controls in de UserControls directory.

using System;
using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace My.WebParts.Editors
{
    public class WebPartEditor : BaseEditorPart
    {
        public WebPartEditor()
        {
            this.ID = "WebPartEditor";
            this.Title = "Web Part Properties";
        }
 
        private string[] _errorMessages = null;
        private string[] _propertyDisplayNames = null;
        private string[] _propertyDescriptions = null;
 
 
        protected override void CreateChildControls()
        {
            this.Controls.Clear();
 
            UserControlWebPart part = this.WebPartToEdit as UserControlWebPart;
            this._errorMessages = new string[1] { null };
            this._propertyDisplayNames = new string[1] { "User control to display" };
            this._propertyDescriptions = new string[1] { "UserControl" };
 
            if (string.IsNullOrEmpty(part.UserControlPath) || (!Directory.Exists(HttpContext.Current.Server.MapPath(part.UserControlPath))))
            {
                TextBox userControlTextBox = new TextBox();
                userControlTextBox.ID = part.ID + "UserControlWebPartInput";
                userControlTextBox.AutoPostBack = true;
                userControlTextBox.TextChanged += new EventHandler(userControlTextBox_TextChanged);
 
                userControlTextBox.Text = part.UserControl;
                this.Controls.Add(userControlTextBox);
            }
            else
            {
                DropDownList userControlList = new DropDownList();
                userControlList.ID = part.ID + "UserControlWebPartSelect";
                userControlList.AutoPostBack = true;
                userControlList.SelectedIndexChanged += new EventHandler(userControlList_SelectedIndexChanged);
 
                DirectoryInfo directory = new DirectoryInfo(this.Page.Request.MapPath(part.UserControlPath));
                FileInfo[] files = directory.GetFiles("*.ascx");
 
                if (files.Length > 0)
                {
                    userControlList.DataSource = files;
                    userControlList.DataTextField = "Name";
                    userControlList.DataValueField = "Name";
                    userControlList.DataBind();
                    userControlList.Items[0].Selected = true;
 
                    if (!string.IsNullOrEmpty(part.UserControl))
                    {
                        ListItem item = userControlList.Items.FindByValue(part.UserControl.Substring(part.UserControlPath.Length + 1));
                        if (item != null)
                        {
                            userControlList.Items[0].Selected = false;
                            item.Selected = true;
                        }
                        else
                        {
                            this._errorMessages[0] = string.Format("The file {0} does not exist.", part.UserControl);
                        }
                    }
 
                    if (string.IsNullOrEmpty(part.SelectedUserControl))
                    {
                        part.SelectedUserControl = part.UserControlPath + "/" + userControlList.SelectedValue;
                    }
                }
 
                this.Controls.Add(userControlList);
 
            }
        }
 
        protected override void RenderContents(HtmlTextWriter writer)
        {
            if (this.Page != null)
            {
                this.Page.VerifyRenderingInServerForm(this);
            }
            this.EnsureChildControls();
 
            WebControl[] propertyEditors = new WebControl[] { (WebControl)this.Controls[0] };
            RenderPropertyEditors(writer, this._propertyDisplayNames, this._propertyDescriptions, propertyEditors, this._errorMessages);
        }
 
        private string RequestUserControl(string id, string path)
        {
            if (Array.IndexOf<string>(this.Page.Request.Form.AllKeys, this.UniqueID + "$" + id + "UserControlWebPartInput") > -1)
            {
                return this.Page.Request.Form[this.UniqueID + "$" + id + "UserControlWebPartInput"];
            }
            else
            {
                if (this.Page.Request.Form[this.UniqueID + "$" + id + "UserControlWebPartSelect"] == "None")
                {
                    return null;
                }
                else
                {
                    return path + "/" + this.Page.Request.Form[this.UniqueID + "$" + id + "UserControlWebPartSelect"];
                }
            }
        }
 
        void userControlList_SelectedIndexChanged(object sender, EventArgs e)
        {
            UserControlWebPart webPart = this.WebPartToEdit as UserControlWebPart;
 
            webPart.SelectedUserControl = RequestUserControl(webPart.ID, webPart.UserControlPath);
        }
 
        void userControlTextBox_TextChanged(object sender, EventArgs e)
        {
            UserControlWebPart webPart = this.WebPartToEdit as UserControlWebPart;
 
            webPart.SelectedUserControl = RequestUserControl(webPart.ID, webPart.UserControlPath);
        }
 
        public override bool ApplyChanges()
        {
            UserControlWebPart webPart = this.WebPartToEdit as UserControlWebPart;
 
            this._errorMessages = new string[1] { null }; 
            webPart.UserControl = RequestUserControl(webPart.ID, webPart.UserControlPath);
            webPart.SelectedUserControl = webPart.UserControl;
            webPart.LoadUserControl();
 
            return true;
        }
 
        public override void SyncChanges()
        {
        }
 
    } 
}

In the AboutEditor I only added the method RenderContents, which is responsible for rendering the about info as content. Nothing fancy in the code and everything looked rather simple. In this control I will not only add the method RenderContents but also CreateChildControls. The last method is needed, because I'm not only rendering content, I'm creating events as well. As I said before "To know how you should create a good WebPart you must be very confident with the Web load- and event handlers model." Because this is hard to explain, I'm not discussing these principles here.

The first thing which is different comparing to the other editor part. It doesn't inherit from EditorPart but it inherits from BaseEditorPart. This class is an abstract class and has some default implementations for rendering properties. Another difference is the reference between the WebPart and the EditorPart. This can be accomplished by the following line of code.

UserControlWebPart part = this.WebPartToEdit as UserControlWebPart;

CreateChildControls
This method will create the child controls for the editor part. In this method I will detect if the given user controls directory exists and display the user control files in it in a combobox. When it can't find the directory it will give the user a textbox to type the full path to the user control. I used the CreateChildControls method because I want to some eventhandling as well. In this method I add to either of the selected choice an event which will be called after the value of the user control to display changes.

RenderContents
For the rendering I wrote my self a method named RenderPropertyEditors which is stored in the base class BaseEditorPart. This method handles all properties and depending on their type it will be rendered as TextBox (String, DateTime), DropDownList (Enum) or a RadioButton (Boolean). By doing this I can reuse the code for my other editor part which will be displaying the properties of a user control.

RequestUserControl
This method requests the form which UserControl is given or selected by the user. This depends on if the user types the user control in a textbox or selects it from a combobox.

ApplyChanges
Saves the values in an EditorPart control to the corresponding properties in the associated WebPart control. When the values are applied, it loads the selected user control. I set the WebBrowsable property of the UserControl property to false and added a new property SelectedUserControl. The UserControl property will be stored, so the next time the WebPart is rendered it uses te stored UserControl. The SelectedUserControl is only used for the editor parts. By doing so I can eventually reload the selected UserControl for accessing its properties without rendering it to the browser. 

[WebBrowsable(false), Personalizable(true)]
public string UserControl
{
  get
  {
    return this._userControl;
  }
  set
  {
    this._userControl = value;
  }
}
 
[WebBrowsable(false)]
public string SelectedUserControl
{
  get
  {
    string editorUserControl = ViewState["EditorUserControl"] as string;
    if (string.IsNullOrEmpty(editorUserControl))
    {
      return UserControl;
    }
    else
    {
      return editorUserControl;
    }
  }
  set
  {
    ViewState["EditorUserControl"] = value;
  }

When using this WebPart in my test portal it will give the image below.


UserControl in ASP.NET 2.0 Portal using my own UserControl WebPart

As you can see in the image, I now have create my an editor part which customizes  / personalizes a WebPart.

Summary
Hopefully you're even more impressed as I am, because it's so simple to create such a powerfull EditorPart. Microsoft did a great job and made it possible with the ASP.NET 2.0 Framework to create simple but cool WebParts. In the next part I'm going to create another editor part which will display the properties of the user control.

Building my own UserControl WebPart part IV

In this fourth article about my own UserControl WebPart I will explain how a WebPart can use its own editor parts. Editor parts are very handy when it comes to customizing / personalizing and categorizing the WebPart. In this blog I will only show you how to add an editor part and how to use it to display some common info about the WebPart.

When implementing a editor part you have to do the following steps.

Step 1 Create a class which inherits from EditorPart

namespace My.WebParts.Editors
{
    public class AboutEditor : System.Web.UI.WebControls.WebParts.EditorPart
    {
 
    }
}

Step 2 Implements its methods

namespace My.WebParts.Editors
{
    public class AboutEditor : System.Web.UI.WebControls.WebParts.EditorPart
    {
        public override bool ApplyChanges()
        {
            return true;
        }
 
        public override void SyncChanges()
        {
        }
 
    }
}

Since I don't use the editor part to edit my WebPart I'm not obligated to add any code to the ApplyChanges (Saves the values in an EditorPart control to the corresponding properties in the associated WebPart control.) and SyncChanges (Retrieves the property values from a WebPart control for its associated EditorPart control.) methods.

Step 3 Create a useful editor part

using System.Reflection;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
 
namespace My.WebParts.Editors
{
    public class AboutEditor : EditorPart
    {
        public AboutEditor()
        {
            this.ID = "AboutEditor";
            this.Title = "About";
        }
 
        protected override void RenderContents(HtmlTextWriter writer)
        {
            writer.WriteLine("UserControl WebPart");
            writer.WriteBreak();
            writer.WriteLine("Version " + Assembly.GetExecutingAssembly().GetName().Version.ToString());
            writer.WriteBreak();
            writer.WriteBreak();
 
            writer.WriteLine("Created by: ");
            writer.AddAttribute(HtmlTextWriterAttribute.Href, "http://bloggingabout.net/blogs/mglaser");
            writer.AddAttribute(HtmlTextWriterAttribute.Target, "_blank");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write("Mike Glaser");
            writer.RenderEndTag();
            writer.WriteBreak();
            writer.WriteBreak();
 
            writer.AddAttribute(HtmlTextWriterAttribute.Href, "http://www.class-a.nl");
            writer.AddAttribute(HtmlTextWriterAttribute.Target, "_blank");
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write("www.class-a.nl");
            writer.RenderEndTag();
        }
 
        public override bool ApplyChanges()
        {
            return true;
        }
 
        public override void SyncChanges()
        {
        }
 
    }
}

Step 4 Extend your WebPart class to implement the IWebEditable interface

public class UserControlWebPart : WebPart, IWebEditable

Step 5 Implement the CreateEditorParts method and use the editor part

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI;
 
using My.WebParts.Editors;
 
namespace My.WebParts
{
    public class UserControlWebPart : WebPart, IWebEditable
    {
        public UserControlWebPart()
        {
            this._userControlPath = "/UserControls";
        }
 
        private UserControl _control;
        private string _userControlPath;
        private string _userControl = string.Empty;
 
        [WebBrowsable(false), DefaultValue("/UserControls")]
        public string UserControlPath
        {
            get
            {
                return this._userControlPath;
            }
            set
            {
                this._userControlPath = value;
            }
        }
 
        [WebBrowsable(true), Personalizable(true)]
        public string UserControl
        {
            get
            {
                return this._userControl;
            }
            set
            {
                this._userControl = value;
            }
        }        
 
        protected internal void LoadUserControl()
        {
            if (!string.IsNullOrEmpty(this._userControl))
            {
                base.CreateChildControls();
                this.Controls.Clear();
                this._control = (UserControl)Page.LoadControl(this._userControlPath + "/" + this._userControl);
 
                this.Controls.Add(this._control);
            }
        }
 
        protected override void CreateChildControls()
        {
            try
            {
                LoadUserControl();
            }
 
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
 
        EditorPartCollection IWebEditable.CreateEditorParts()
        {
            List<EditorPart> editors = new List<EditorPart>();
            editors.Add(new AboutEditor());
            return new EditorPartCollection(editors);
        }
 
   }
}

When using this WebPart in my test portal it will give the image below.


UserControl in ASP.NET 2.0 Portal using my own UserControl WebPart

As you can see in the image, I now have create my first editor part.

Summary
I only showed how to use an editor part, but I didn't show how to customize / personalize a WebPart using this editor part. In the next parts I will create the two other editor parts. One article will be about selecting the user control, the other about displaying properties of it.

How to upgrade your MSF Process Guidance with DB Pro

As my colleague Anko mentioned in his blog MSF finally rocks. Anko has been working with MSF for ages and is really one of the MSF dinosaurs. While working with him he told and teach me a lot about MSF. Besides Business Intelligence (BI), Team foundation Server(TFS) is one of objectives and is very strong connected to MSF. Since TFS is being used by more and more companies MSF rocks as well. The result is that we are more and more invited to talk about MSF in combination with TFS. I like to talk about it and hope you will be interested too.

The presentations:

  1. Cyco Software (in-company, 21 November)
  2. DotNed (23 November)

At Tech•Ed: IT Forum in Barcelona, Spain, Bob Muglia also announced updated MSF process guidance to support users of Team Edition for Database Professionals (see Promise to Customers: Advance the Business With IT Solutions).

Process guidance for database professionals included in the Microsoft Solutions Framework. This process guidance is the first of its kind in the industry and demonstrates Microsoft’s commitment to making the database professional a full-fledged participant in the application life cycle.

You can download the updated process guidance today:

MSF for Agile Software Development Process GuidanceMSF for Agile Software Development Process Guidance
This download contains an update to the agile process guidance that ships with Visual Studio 2005 Tem System. MSF for Agile Software Development is a scenario-driven, context-based, agile software development process that utilizes many of the ideas embodied in Team System. Version 4.1 provides new guidance for the Database Professionals to use Visual Studio Team Edition for Database Professionals.

MSF for CMMI Process Improvement Process GuidanceMSF for CMMI Process Improvement Process Guidance
This download includes the MSF for CMMI® Process Improvement process guidance, which is a highly iterative, adaptive planning, agile software development process which meets the requirements for the Software Engineering Institute's (SEI) Capability Maturity Model Integration (CMMI) level 3. Version 4.1 provides new guidance for the Database Professionals to use Visual Studio Team Edition for Database Professionals.

Finally the team has added a complete WssTasks.xml, so you can easily upgrade your process guidance for new projects as well. In the next following steps I will explain it to you.

Update your Process Guidance template

Step 1 Download the process template you want to update guidance on

Step 2 Remove all files from the “Windows SharePoint Services” folder in the process template you downloaded

Step 3 Extract your Process Guidance 4.1 to the “Windows SharePoint Services” folder

Step 4 Upload the updated process template back to TFS

Step 5 Create a new project based on the updated Process Guidance

Before uploading you can delete the first Process Guidance, cause all other projects based on the previous Guidance have already created their own sources. In the next steps I will explain how to easily update your other projects.

Update your SharePoint Document Libraries

Step 1 Map a Network Drive to the SharePoint Document Library Process Guidance
e.g. http://Server/Sites/Team Project/Process Guidance (Server name of machine or site; Team Project name of project). Make sure your WebClient service is started.

Step 2 Extract the contents of the Process Guidance 4.1 to a temp folder

Step 3 Bulk copy all the files from Process Guidance to the share

Step 4 Update all other Document Libraries (Project Management, Requirements, Security & Test)

After these steps your projects will contain the newest Process Guidance. You can test if the upgrade succeeded by opening the following URL http://Server/Sites/Team Project/Process Guidance/Supporting Files/DatabaseDeveloper.htm and check if the Database Administrator and Database Developer are added to your team roles.


Updated Process Guidance - MSF 4.1 

Summary
The data team did a great job to not only add a nice add-on to Visual Studio Team System, but also extended the Process Guidance so the add-on also fits perfectly in MSF.

Building my own UserControl WebPart part III

Since my colleagues Dennis and Alex are writing articles by the minute, it was time for me to do the same. Dennis is writing some very interesting articles about WCF (Windows Communication Foundation) and Alex is doing the same about Unit Testing in Visual Studio .NET 2005.

Unfortunately I wasn't able to write about my own UserControl WebPart for a long time. One thing was, I had to so much other stuff (training, consult, family & friends), it didn't give me much spare time. An other thing was, I wasn't able to copy my code formatted, as I like it, from my SharePoint development environment running on a VPC. I had to spend some time on this problem too.

In this third part I'm going to write about creating an ASP.NET 2.0 WebPart which dynamically loads a UserControl and can be used in a SharePoint or an ASP.NET 2.0 Portal. Before I start I will mention I haven't coded any .NET language for over a year now. So if you have any improvements or comments, please let me know. As I described in my first article about WebParts, to use an ASP.NET 2.0 WebPart in SharePoint you don't have to do a lot of things. One thing which is really important is to make sure you will inherit from the correct WebPart.

using System;
 
namespace Sample.TestWebParts
{
    public class Class1 : System.Web.UI.WebControls.WebParts.WebPart
    {
    }
}

When doing so you could stop here, but it is nice when your WebPart becomes rendered it shows some information. In this example I'll show code which displays 'Superb' as a text when the WebPart hits the page.

using System;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
 
namespace Sample.TestWebParts
{
    public class Class1 : WebPart
    {
        protected override void CreateChildControls()
        {
            Label control = new Label();
            control.Text = "Superb";
 
            this.Controls.Add(control);
        }
 
    }
}

or

using System;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
 
namespace Sample.TestWebParts
{
    public class Class1 : WebPart
    {
        protected override void Render(HtmlTextWriter writer)
        {
            writer.Write("Superb");
        }
    }
}

To know how you should create a good WebPart you must be very confident with the Web load- and event handlers model. Because this is hard to explain, I'm not discussing these principles here. I hope you understand this is the reason why I want to build my own UserControl WebPart. With this WebPart you can concentrate on business problems instead of technical problems. In mine last article I explained how I like to use a UserControl and where it should be stored. So for displaying it dynamically you can use this code.

using System;
using System.ComponentModel;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI;
 
namespace My.WebParts
{
    public class UserControlWebPart : WebPart
    {
        public UserControlWebPart()
        {
            this._userControlPath = "/UserControls";
        }
 
        private UserControl _control;
        private string _userControlPath;
        private string _userControl = string.Empty;
 
        [WebBrowsable(false), DefaultValue("/UserControls")]
        public string UserControlPath
        {
            get
            {
                return this._userControlPath;
            }
            set
            {
                this._userControlPath = value;
            }
        }
 
        [WebBrowsable(true), Personalizable(true)]
        public string UserControl
        {
            get
            {
                return this._userControl;
            }
            set
            {
                this._userControl = value;
            }
        }        
 
        protected internal void LoadUserControl()
        {
            if (!string.IsNullOrEmpty(this._userControl))
            {
                base.CreateChildControls();
                this.Controls.Clear();
                this._control = (UserControl)Page.LoadControl(this._userControlPath + "/" + this._userControl);
 
                this.Controls.Add(this._control);
            }
        }
 
        protected override void CreateChildControls()
        {
            try
            {
                LoadUserControl();
            }
 
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
 
   }
}

When using this WebPart in my test portal it will give the image below.


UserControl in ASP.NET 2.0 Portal using my own UserControl WebPart

As you can see in the image, all properties which where supplied by the UserControl are disappeared. I have to write my own editor part, which supply the properties by reflection.

Summary
I enjoyed writing some extra info about my own UserControl WebPart. In the next part I will explain how to use editor parts and how they fill into my WebPart.

SQL Server 2005 Service Pack 2 has been released

Update: I updated this article, because MS is shipping the December 2006 preview now.

Microsoft released the SQL Server 2005 Service Pack 2 Community Technology Preview December 2006.  CTP December 2006 will be a public release and the goal of this outreach is to raise awareness of the CTP to solicit community feedback during the aggressive CTP cycle, while demonstrating the deep integration between SQL Server 2005 and 2007 Office. 

They also created the SQL Server Community Technology Preview Program. Leading up to the release of SQL Server 2005, Microsoft made Community Technology Previews (CTPs) available as public downloads. In addition, they want to highlight the increasing transparency in Microsoft’s development cycle to provide greater predictability to its customers.

Driving Innovation:

Heterogeneous Environments (Interoperability):

  • Oracle Support in Report Builder. Users will now be able to use Report Builder on top of Oracle data sources.
  • Hyperion support with SSRS. Organizations will now be able to use SSRS to build reports on top of Hyperion Essbase cubes.

Performance/Enterprise:

  • Data compression (varDecimal), which is important for data warehouse scenarios and is specifically important for SAP BW scenarios. This requires less disk storage of decimal data which increases overall performance.
  • Manageability enhancements. Based on customer feedback, SQL Server provides enhanced management capabilities for DBAs such as improvements in database maintenance plans, enhanced management reports and a new copy database wizard.

SQL Server Express Edition

  • Management reports have been added to SQL Server Express Edition enabling customers to get insights into the performance of their Express Edition and SQL Server Compact Edition databases.
  • SQL Server Management Studio Express Edition now enables management of SQL Server Compact Edition databases.

SQL Server 2005 SP2 will ship shortly after the launch of Windows Vista and Office. You can find more details about the features in SP2 at http://go.microsoft.com/fwlink/?LinkId=71711.

 

Technorati tags:
Visual Studio 2005 - Ready for a New Day

Why blog about every tool which is made available this week for Visual Studio 2005, when Microsoft has their own development site Ready for a New Day to show them. You can download a collection of tools you can use today with Visual Studio 2005 to develop solutions for Windows Vista and the 2007 Office system.
Visual Studio 2005 SP1 and Hotfixes

VS Service Pack 1
The Visual Studio 2005 Service Pack 1 Beta Program closed on October 30, 2006. More than 10,000 users participated in this program and they have reviewed over 350 bugs and suggestions. The Visual Studio 2005 SP1 Beta and Visual Studio 2005 TFS SP1 Beta are still available for download on the Microsoft Download Center. After closing the program I hope they will soon release the gold version.

Visual Studio 2005 Service Pack 1 will focus on addressing product issues reported since the release of Visual Studio 2005. Hotfixes included in the Beta Service Packs:

KB Article Fix Description
KB898904 Update to the Web Project Conversion Wizard in Visual Studio 2005
KB909350 FIX: You receive LNK2001 and LNK1120 error messages when you use the Vcbuild.exe command-line tool to build a Visual C++ solution
KB910275 FIX: The customized color code marker that is actually added may differ from the customized color code marker that you try to add in Visual Studio 2005
KB910832 FIX: The IDE stops responding when you work with nested generic types in C# in Visual Studio 2005
KB911281 FIX: A native application takes a long time to start when you try to debug the application by using Visual Studio 2005
KB912019 FIX: You may receive an error message when you rebuild a solution and try to view a Windows Form in Design view in Visual Studio 2005
KB913377 FIX: IntelliSense may stop working, and Visual Studio may crash, when you try to open a large Managed C++ project in Visual Studio 2005
KB913432 FIX: The IDE stops responding when you build a project that generates lots of text in the Output window in Visual Studio 2005
KB913940 An attributed ATL-based COM server unexpectedly exits in Visual Studio 2005
KB913951 FIX: The browser may stop responding when you scroll through a Visual J# 2005 Web page that contains a J# Browser Control
KB913996 FIX: Error message when you use the debugger in Visual Studio 2005 to debug an MFC class library application: "Managed Debugging Assistant 'Loader Lock' has detected a problem in ''"
KB915038 FIX: You may receive Visual Basic compiler error messages when you are developing a Visual Basic 2005 project in Visual Studio 2005
KB915110 FIX: Visual Studio 2005 may stop responding when you build a Web application project that is checked out of Visual SourceSafe
KB915364 Update to support Visual Studio 2005 Web Application Projects
KB915418 FIX: An access violation may occur when you try to run a Visual C++ 2005 application that contains OMG CORBA IDL code
KB915423 FIX: Error message when you use certain code patterns that involve the IDisposable interface in the Visual Studio 2005 C++ compiler: "Fatal error C1001"
KB915781 FIX: You may receive an incorrect error message when you open a Visual Studio 2005 Tools for Office document
KB916632 FIX: All the applications that use the C run-time library may not start after you install Visual Studio 2005 and then you uninstall Visual Studio 2005 without restarting the computer
KB916688 FIX: Error message when you try to use the Visual SourceSafe 2005 LAN booster service together with Visual Studio 2005 on a server that is running Windows 2000: "Unable to use SourceSafe LAN service"
KB916769 FIX: The Visual Studio 2005 IDE stops responding when you work with a large Visual C++ .NET solution in Visual Studio 2005
KB916812 FIX: The report does not print the first time that you click Print when you try to print the report from the Report Viewer control in Visual Studio 2005
KB917036 FIX: The Visual Studio 2005 IDE may corrupt the deployment files for a Web Setup Project and for a Setup Project
KB917141 FIX: The position of the Properties window may not be saved after you exit Visual Studio 2005 on a dual-monitor system
KB917147 FIX: The Cole Property Page object of a Visual C++ application may be deleted when the Bound Property Changed function is invoked, and Visual Studio 2005 may unexpectedly close (crash)
KB917291 FIX: Custom build steps may not run when you add the custom build steps to a Visual C++ 2005 Win32 static library project in Visual Studio 2005
KB917327 FIX: Japanese, Chinese, or Korean characters in resource files may be overwritten by question marks after you convert a Visual C 6.0-based project to Visual Studio 2005
KB917452 FIX: You may experience performance issues when you use solutions that contain large Visual Basic projects in Visual Studio 2005
KB918373 FIX: The Atls.pdb file and the Atlsd.pdb file contain incomplete debugging information when you debug an ATL-based C++ application in Visual Studio 2005
KB918553 FIX: A floating-point exception may occur when an inline function in a C++ application returns an uninitialized floating-point variable in Visual Studio 2005
KB918559 FIX: You may experience slow performance and increased memory usage when you start the debugger for a Visual C++ project in Visual Studio 2005
KB919232 FIX: MS Project Work Item Publish Error
KB919280 How to rebuild the C++ STL library for Visual Studio 2005
KB919904 FIX: You may receive an error message when you try to build a Web project that references a .NET Compact Framework 2.0 assembly in Visual Basic 2005
KB920145 FIX: You may receive an error message when you consume an assembly that has an obfuscated generic type in Visual Studio 2005
KB920770 FIX: You may receive a "Fatal error C1902" error message and a solution build may fail when you try to use the AT command or a scheduled task to automate a build of a C or C++ project in Visual Studio 2005
KB920805 FIX: You may experience slow performance when you work with a Visual Basic solution that contains many projects in Visual Studio 2005
KB923147 FIX: Visual Studio 2005 exits unexpectedly when you try to edit an existing Data Table object or add a new Data Table object to the dataset that you are editing

TFS Service Pack 1

  • Version Control - WorkItem Tracking and Datawarehouse performance/scale improvements.
  • "Extranet support" - An ISAPI filter is implemented that will allow the intranet to use NTLM and integrated auth while the extra net uses basic auth.  This enables TFS to be more easily deployed in environments where people on the Internet need to be able to access TFS without having VPN.
  • WIT Custom Control support - This is a mechanism by which people can design work item forms that host custom controls.  The data behind the controls can either be persisted in WIT fields or elsewhere. 
  • Support for Office 2007 support (Project and Excel - no SharePoint 2007 support yet)

    Please don't try to install TFS with SharePoint 2007 at this point - it will not work.  Microsoft is working on SharePoint 2007 support for Orcas - it will not be in SP1.
  • Detailed Merge History - In V1 not all information was exposed from the server necessary to build all of the sophisticated change tracking tools we use internally that track the flow of changes through branches.  The server "summarized" merge history information too much and information was only approximated. SP1 includes a new web service method and object model API that allows access to the detailed information.  The new API is called QueryMergesWithDetails on the SourceControl object.
  • Separating the SQL Analysis Services Server - For more flexible deployment topologies you now can install Sharepoint on separate servers, SQL Named instances, Reporting services on separate servers and more.  SP1 has one small step in that direction by including the change necessary to support TFS using SQL Analysis Server installed on a separate machine. 

Hotfixes
An other thing that caught my attention is is the DevDiv Hotfix Public Availability Pilot Program which is an initiative of the Microsoft team to help make the Visual Studio 2005 hotfixes more generally available. Of course you can download them, but you can also see that a hotfix exist and how to apply it if needed. Most hotfixes on the site aren't required if you are running the Visual Studio 2005 SP1 Beta.

Windows SharePoint Services 3.0 Tools: VS 2005 Extensions

You had to wait some time, but the team finally delivered the Visual Studio 2005 extensions for Windows SharePoint Services 3.0. This tools are for developing custom SharePoint applications: Visual Studio project templates for Web Parts, site definitions, and list definitions; and a stand-alone utility program, the SharePoint Solution Generator.

This Community Technology Preview (November CTP) of the Visual Studio 2005 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:

Visual Studio 2005 Project Templates

  • Web Part
  • Team Site Definition
  • Blank Site Definition
  • List Definition

Visual Studio 2005 Item Templates (items that can be added into an existing project)

  • Web Part
  • Custom Field
  • List Definition (with optional Event Receiver)
  • Content Type (with optional Event Receiver)
  • Module

 

SharePoint Solution Generator
  • This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.

Office 2007 will be released within a week

Windows Vista and Office 2007 will be available through MSDN Subscriber downloads within 7 days of release to manufacture (RTM). MSDN Subscriptions is committed to making new content available to our subscribers as soon as is practical.

Microsoft yesterday announced the completion of the 2007 Microsoft® Office system code and confirmed its release to manufacturing (RTM). Here is the official announcement.

For the new Office site go here.

So let's hope Vista will be RTM'ed soon. So everybody can reinstall their system.

Blogs.msdn.com gives a Critical Error

Not so long ago, my colleague blogged about an error on the MSDN site. He blogged about their password was expired. Today I was browsing the MSDN blog site and it gave me this error.

It looks like a Community Server problem, so perhaps somebody of this Blog can help them ;-)

.NET Framework 3.0 has been released!

Via Microsoft:

The Microsoft .NET Framework 3.0 is the new managed code programming model for Windows®. It combines the power of the .NET Framework version 2.0 with new technologies for building applications that have visually compelling user experiences, seamless communication across technology boundaries, and the ability to support a wide range of business processes. These new technologies are Windows Presentation Foundation, Windows Communication Foundation, Windows Workflow Foundation, and Windows CardSpace. The .NET Framework 3.0 is included as part of the Windows Vista™ operating system; you can install it or uninstall it using Windows Features Control Panel. This redistributable package is for Windows XP and Windows Server 2003.

The .NET Framework 3.0 has officially been released!  You can download the .NET Framework 3.0 components here:

  • Microsoft .NET Framework 3.0 Redistributable Package

  • Microsoft® Windows® Software Development Kit for Windows Vista™ and .NET Framework 3.0 Runtime Components

    The Microsoft® Windows® Software Development Kit (SDK) provides the documentation, samples, header files, libraries, and tools you need to develop applications that run on Windows.

    The Windows SDK includes content for application development with the APIs in Windows Vista, including the .NET Framework 3.0 technologies: .NET Framework 2.0, Windows® Presentation Foundation, Windows® Communication Foundation, Windows® Workflow Foundation, and Windows CardSpace™.

  • Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)

    Windows Workflow Foundation is the programming model, engine, and tools for quickly building workflow-enabled applications on Windows. It consists of a Microsoft .NET Framework 3.0 namespace (System.Workflow), an in-process workflow engine, and designers for Microsoft Visual Studio 2005.

  • Visual Studio 2005 extensions for .NET Framework 3.0 (WCF & WPF), November 2006 CTP

    The Visual Studio 2005 extensions for.NET Framework 3.0 (WCF & WPF), November 2006 CTP provides developers with support for building .NET Framework 3.0 applications using the released version of Visual Studio 2005. These tools are provided as an early preview of technology being considered for the Orcas release of Visual Studio. These tools are not supported by Microsoft but provided as is to enable early adoption of the .NET Framework 3.0 platform. Users will be expected to upgrade to the Visual Studio Orcas release when that becomes commercially available.

  • Microsoft Pre-release Software Visual Studio Code Name "Orcas" - October Community Technology Preview (CTP)

    Visual Studio Code Name "Orcas" delivers on Microsoft’s vision of smart client applications by enabling developers to rapidly create connected applications that deliver the highest quality rich user experiences. This new version enables any size organization to rapidly create more secure, manageable, and more reliable applications that take advantage of Windows Vista and the 2007 Office System. By building these new types of applications, organizations will find it easier than ever before to capture and analyze information so that they can make effective business decisions.

    Read all about "Orcas" on the blog of Erwyn van der Meer

Note, if you are using Windows Vista the .NET Framework 3.0 Runtime Components are installed by default.

The Readme for the released version of the .NET Framework 3.0 is available here.  If you have a previous CTP installed, please be sure to use the Pre-released Microsoft .NET Framework 3.0 Uninstall Tool. If you have questions about installing the .NET Framework 3.0, please post your questions to the .NET Framework Setup Forum.

Posted: Tue, Nov 7 2006 7:46 AM by Mike Glaser | with 2 comment(s)
Filed under:
Using CopySourceAsHTML in a Windows 2003 VPC environment

Introduction
CopySourceAsHTML will give you an error while using it in a Microsoft Virtual PC (I'm probably the last Mohican whose using MS VPC, but that's mine problem). The exact message is "Requested Clipboard operation did not succeed".


Error message

While searching the Internet I found lots of people complaining about this error using all kinds of apps (including in MOC labs of Microsoft which use a VPC). For me this error only occurs during this add-in. In my last blog I already talked about debugging an add-in is easy, so I was ready to solve this problem.

CopySourceAsHTML
Code is exponentially more readable when certain parts of that code are differentiated from the rest by using a different color text. Reading code in Visual Studio is generally much easier than trying to read code in an editor like Notepad.

Chances are you may have your own blog by now, or at least have spent some time reading them. Normally, when you try to post a cool code snippet to your blog it ends up being plain old text, which isn't the easiest thing to read. This is where the CopySourceAsHTML add-in comes in to play. This add-in allows you to copy code as HTML, meaning you can easily post it to your blog or Web site and retain the coloring applied through Visual Studio.

After installing the CopySourceAsHTML add-in, simply select the code you want to copy and then select the Copy Source as HTML command from the right-click menu. After selecting this option you will see the dialog box.


Options for CopySourceAsHTML

From here you can choose what kind of HTML view you want to create. This can include line numbers, specific tab sizes, and many other settings. Of course I use Jan Schreuder's style guide for the file style. This style creates an easy browsable frame inside your page

border-top: windowtext 1pt solid;
border-top-color: #CCCCCC;
padding-top: 1pt;
border-left: windowtext 1pt solid;
border-left-color: #CCCCCC;
padding-left: 1pt;
border-right: windowtext 1pt solid;
border-right-color: #CCCCCC;
padding-right: 1pt;
border-bottom: windowtext 1pt solid;
border-bottom-color: #CCCCCC;
padding-bottom: 1pt;
width: 100%;
overflow: auto;
background-color: #F5F5F5;
Jan's File Style

After clicking OK, the HTML is saved to the clipboard. For instance, suppose you were starting with the following code snippet inside Visual Studio:

namespace mynamespace.Service
{
[WebService(Namespace="http://domain/Application/Service/V1.0")]
public class MyService : System.Web.Services.WebService
{
...
[WebMethod]
public string Foo()
{ ... }
[WebMethod]
public void Bar(string s1, string s2)
{ ... }
...
}
}

Normal Copied Code

After you select Copy As HTML and configure the HTML to include line numbers, this code will look like this.

namespace mynamespace.Service
 {
   [WebService(Namespace="http://domain/Application/Service/V1.0")]
   public class MyService : System.Web.Services.WebService
   {
   ...
 
     [WebMethod]
     public string Foo()
     { ... }
 
     [WebMethod]
     public void Bar(string s1, string s2)
     { ... }
 
   ...
   }
 }
CopySourceAsHTML Code

Modify CopySourceAsHTML  
Reading this blog Copying Visual Studio code snippets to the clipboard as HTML I found a nice conversation between the owners of "FormatToHtml macro" and "CopySourceAsHTML". When I was reading this configuration I saw one of my blogger's Bryant Likes also mentioned the error I described. On another forum Requested Clipboard operation did not succeed, people were complaining about the same error as well. While reading all the post, someone mentioned it could be that the clipboard is locked for the current thread, which can be solved by creating a new thread. I introduced the new thread into the add-in and it's working perfectly. In the next frames I will show you the modifications.

namespace JTLeigh.Tools.CopySourceAsHtml
{
 
    internal static class Clipboard
    {
 
        public static string GetRtf()
        {
            if (!System.Windows.Forms.Clipboard.ContainsText(TextDataFormat.Rtf))
            {
                return null;
            }
            return System.Windows.Forms.Clipboard.GetText(TextDataFormat.Rtf);
        }
 
        public static void SetHtml(string html)
Clipboard.cs original source

namespace JTLeigh.Tools.CopySourceAsHtml
{
 
    internal static class Clipboard
    {
 
        private static string _rtf = null;
 
        public static string GetRtf()
        {
            return _rtf;
        }
 
        private static void GetClipboardPrivate()
        {
            if (!System.Windows.Forms.Clipboard.ContainsText(TextDataFormat.Rtf))
            {
                _rtf = null;
            }
            _rtf = System.Windows.Forms.Clipboard.GetText(TextDataFormat.Rtf);
    }
 
        public static void StartThread()
        {
            Thread thread = new Thread(new ThreadStart(GetClipboardPrivate));
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            thread.Join();
        }
 
        public static void SetHtml(string html)
Clipboard.cs modified source

try
                {
                    Clipboard.StartThread();
                    rtf = Clipboard.GetRtf();
                    if (rtf == null)
                    {
                        MessageBox.Show(Resources.NoRtfDataOnClipboardMessage, Resources.NoRtfDataOnClipboardCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                }
                catch (ExternalException)
                {
                    MessageBox.Show(Resources.UnableToAccessClipboardMessage, Resources.UnableToAccessClipboardCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
Connect.cs modified source

Compile the new code and overwrite the current CopySourceAsHtml.AddIn in \Documents and Settings\<user name>\My Documents\Visual Studio 2005\Addins.

Summary
Anything that makes it easier to share and understand code benefits all of us as it means more people will go to the trouble of sharing knowledge and learning from each other. CopySourceAsHTML was written by Colin Coller and can be downloaded from www.jtleigh.com/CopySourceAsHtml. I will notice Colin to show him mine solution to use his add-in in Virtual PC environment. Meanwhile I will ask the moderator of this site, also a fan of this add-in to post a compiled dll, so other users can easily use this add-in in a VPC.

You can download an already modified DLL here.

How to debug a Visual Studio .NET 2005 Add-In

In Visual Studio .NET 2002 and Visual Studio .NET 2003, you were required to register add-in assemblies with Windows as COM components by using the Assembly Registration Tool (regasm.exe). Also, you were required to register the add-in with Visual Studio by using keys in the Windows registry before the add-in would appear in the Add-In Manager.

These steps have changed in Visual Studio 2005. You no longer need to register the .NET assemblies with Windows by using regasm. Instead, you simply place the assembly .DLL file into a specific directory along with an XML file that has an .Addin file extension. This XML file describes the information that Visual Studio requires to display the add-in in the Add-In Manager. When Visual Studio starts, it looks in the .Addin File location (listed below) for any available .Addin files. If it finds any, it reads the XML file and provides the Add-In Manager with the information needed to start the add-in when it is clicked.

This simplified registration method allows XCopy-style installations for managed code add-ins. If you put all the files in the right place, then your add-in works just fine. Also, its use of commented XML to define the registration settings for add-ins allows the information to be more easily understood and edited than registry keys.


Application Configuration

However for debugging an add-in you have to one other thing. In the Debug tab you have to select an external program which will start a new development environment . This application can handle command-line arguments. The argument for resetting an add-in is resetaddin which expects a full class name.


Debug Configuration

The following is an example of a complete .Addin XML file. The .Addin file is usually placed at \Documents and Settings\All Users\My Documents\Visual Studio 2005\Addins or \Documents and Settings\<user name>\My Documents\Visual Studio 2005\Addins. The Assembly node (in bold) specifies the location of the (debug) add-in binaries. This field can be set to a local path, a network path, or a valid URL.

<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
  <HostApplication>
    <Name>Microsoft Visual Studio</Name>
    <Version>8.0</Version>
  </HostApplication>
  <Addin>
    <FriendlyName>w00t</FriendlyName>
    <Description>w00t</Description>
    <Assembly>[Path to add-in]\w00t.dll</Assembly>
    <FullClassName>MGlaser.Tools.w00t.Connect</FullClassName>
    <LoadBehavior>1</LoadBehavior>
    <CommandPreload>0</CommandPreload>
    <CommandLineSafe>0</CommandLineSafe>
  </Addin>
</Extensibility>
w00t - For Testing.AddIn

Summary
It's really easy to debug an add-in these days. The reason why I want to show you this cause one of mine w00test add-ins doesn't work in mine virtual PC images. I hope to bring you the good news tommorow if I was able to extend this add-in, so it can work on a VPC as well.

Visual Studio 2005 Team Edition for Database Professionals CTP7

The Microsoft Data Dude Team is proud to announce that CTP7 (2.0.50727.222) is already here. I was only able to use CTP6 for two weeks since Microsoft released it and they already updated their product again. CTP7 of Visual Studio Team Edition for Database Professionals aka "Data Dude" can be found here. This version as GertD told us is going to be the last CTP before the release of the full version. He also mentioned all the changes carried out in CTP7.


Setup and About screen

Several people already talked about the features and possibilities of the product. Some of them include:

  • Schema and Data Comparison
  • Data Generation
  • Enhanced T-SQL Editor
  • Refactoring
  • Unit Testing
  • Database Deployment

The nice thing of this Visual Studio product, database developers are finally able to work like other programmers. Extreme Programming is useful and through Visual Studio projects and source control more developers will be able to work on a single database. Unfortunally its only possible to create a SQL Server 2000 and 2005 database project. Maybe other 3rd party companies can extend these possibilities. You can also ask yourself the question "Are there any other databases" ;-).

Here are some screen dumps of the product.


Sulution Explorer and Schema View

 
Refactoring a script


Unit testing a script

Summary
I can hardly wait till their RTM will be released. Team Edition for Database Professionals is like an add-on for Visual Studio Team Edition. I don't understand why they didn't create all team editions as add-ons. Now you always have to use a complete iso-images to only add a few extra tools for testing (for Testers) or modelling (for Architects)

In this blog you can read The What, The Why, The How of Visual Studio Team Edition for Database Professionals.