Friday, December 23, 2011

HTML 5 and CSS: Six Complete Lessons

You want to learn HTML 5 and CSS? Microsft has created six complete lessons that cover the most interesting and dynamic new features of HTML 5 that are ready to drop into a web development or intro programming course. Each lesson comes with instructor PowerPoint slides, a complete reading assignment with hands-on examples, including the files and assets to use in each assignment. A single lesson has enough content for a 75-100 minute class session, and the hands-on examples are great for either a lab session or homework assignment.

The six lessons are:

  • Lesson 1 – Defining HTML 5
  • Lesson 2 – Fundamentals of HTML 5, XHTML, and CSS
  • Lesson 3 – Introduction to CSS Layout
  • Lesson 4 – Using HTML 5 Markup
  • Lesson 5 – Working with Canvas
  • Lesson 6 – HTML 5 Multi-Media and Drag and Drop

This content is available at no charge and can be downloaded from here: http://www.mis-laboratory.com/faculty/

Thursday, December 22, 2011

Telerik MVC Grid won't refresh after delete

For a project we are using the Telerik MVC controls. I have to say that I was really pleased with the experience in general, although I had some small issues.

One of the problems I had was with the editing feature of the Telerik MVC Grid. Everything appears to work as expected except for the delete. The delete MVC action is called and the row is  deleted from the database but the grid does not refresh.

[HttpPost]
[GridAction]
public ActionResult DeleteCodetable(string codetableType, Codetable codetable)
{
_codetabelService.Delete(codetable);
//Rebind the grid
return LoadCodetable(codetableType, refreshCache: true);
}


It took me some time to find the answer on the forums. The delete action only passes the id of the element to delete to the action method. This causes some model binding validation errors as the Code and Description field are required on my Codetable object.



public class Codetable
{
[Required]
public virtual int Id { get; set; }
[Required]
public virtual string Code { get; set; }
[Required]
public virtual string Description{ get; set; }
}


By design if there are model state errors (validation didn't work) the grid is not rebound. So when the DeleteCodetable method returns the result, the grid will not refresh. I solved it by introducing the IgnoreModelErrors attribute in my code.



[HttpPost]
[IgnoreModelErrors("Code,Description"]
[GridAction]
public ActionResult DeleteCodetable(string codetableType, Codetable codetable)
{
_codetabelService.Delete(codetable);
//Rebind the grid
return LoadCodetable(codetableType, refreshCache: true);
}

Wednesday, December 21, 2011

Microsoft Product Lifecycle Search

I get a lot of questions about the lifetime and end of support of multiple Microsoft products (especially about one you probably heard of before… Silverlight Knipogende emoticon).

So how do you know how long Microsoft will officially support a product or technology?

It’s not a secret. You only have to browse to the Microsoft Product Lifecycle Search Page and search the product or technology.

Let’s do the test with Silverlight 5:

image

So now it’s official… Silverlight 5 is dead in 2021. I guess that gives you the time you need to upgrade…

Tuesday, December 20, 2011

Look up DB2 error codes: the fast way

I have to admit that I’m not a big fan of DB2 although there is not much wrong with the database itself. I have more problems with the far-from-perfect tooling.

One of the things that keep annoying me are the cryptic error messages including an even more cryptic SQL error code that DB2 returns. Normally I look up the error code in the DB2 Information Center, but if you need a shorter and faster way to get at least a short explanation of what an error code means, you can use the following SQL query:

VALUES SQLERRM(-161)

Result:

1
------------------------------------------------------------------------------------------------------
SQL0161N The resulting row of the insert or update operation does not conform to the view definition.

Monday, December 19, 2011

Team Foundation Server 2010 Power Tools for Eclipse

Visual Studio users already know this for a long time, Microsoft has the Team Foundation Server Power tools. These tools extend the Visual Studio and Team Explorer IDE with lots of extra functionality.

Now these features finally become available to Eclipse Developers as Microsoft released the first version of the Team Foundation Server 2010 Power Tools for Eclipse.

“A set of Team Foundation Server power tools targeted for Eclipse developers already using Team Explorer Everywhere 2010 with SP1 to talk to TFS. This release brings the ability to be able to sign up for Team Foundation Server alerts directly from Eclipse, to save common work item details into a work item template for quick creation of new work items and to allow searching of files in source control by file name, wildcard or by the developer who has the file checked out.”

Friday, December 16, 2011

Techniques to improve your training feedback: The happiness door

Useful feedback is one the best ways to improve your training skills. But how do you know what people think?

Of course you can always ask to fill in a questionnaire but that takes a lot of work, so you probably only do this at the end of your training. But this gives you only a general overview and actually it’s already too late. Wouldn’t it be nice to get feedback during the training and adapt immediately?

One feedback technique I’ll give a try during my next training is ‘The Happiness Door’ as described by Jurgen Appelo in this blog post: http://www.noop.nl/2011/11/the-happiness-door.html. Don’t forget to read his tips before trying this technique.

The method is very simple. You ask people to give you immediate feedback after a training session. They do this by adding notes to on a wall or door and placing it next to the happiness index (5 = excellent … 1 = bad) they want. People can add empty notes or leave some comments.

Happinessdoor

Thursday, December 15, 2011

CSSCop: Integrate CSS Lint into Visual Studio

To all .NET Web developers: this is a must have tool for in your tool belt!

 CSSCop makes it easy to adhere to best practices for writing stylesheets. It catches common errors that affect browser compatibility and much more.

It uses the widely used CSS Lint tool behind the scenes. CSSCop brings it directly into Visual Studio in an easy and convinient way.

Download available here: http://visualstudiogallery.msdn.microsoft.com/a921b98e-9430-4be2-bf53-1169e12bdb50

Wednesday, December 14, 2011

Team Foundation Server WorkItem FieldControl Attributes

Probably the easiest way to customize a TFS WorkItem is by using the Process editor, a part of the TFS Power Tools. Using this editor you can add your own work item fields, customize the layout and change the corresponding workflow. Next to the obvious list of settings there are some less known things you can change using the Attributes property.

image

By using these attributes you can add custom attributes to the Work Item XML. Here are some useful attribute samples:

  • NumberFormat (for FieldControl only): Useful if a number value is displayed in the field. Possible values: WholeNumbers, SignedWholeNumbers, DecimalNumbers, SignedDecimalNumbers. Setting this attribute determines what characters are allowed to be entered in this control.
  • MaxLength (for FieldControl only): Maximum length of allowed characters for field control in form UI.
  • Format (for DateTimeControl only): One of values of DateTimePickerFormat enum. Possible values: Long, Short, Time and Custom. Custom format can be set by having 'Custom' as value for this attribute, and setting another attribute named CustomFormat with actual custom format string.

TF215097: An error occurred while initializing a build for build definition: Cannot create unknown type

While creating some custom build activities for TFS Build I ran into this error

TF215097: An error occurred while initializing a build for build definition \OrdinaALM\TestBuild: Cannot create unknown type '{clr-namespace=Ordina.CustomActivities;assembly=Ordina.CustomActivities}Ndepend'.

I discovered that my solution couldn't be loaded because TFS is looking for a particular attribute to my class. As my custom activity was completely build in XAML I had to use a partial class definition to get the attribute added.

namespace Ordina.CustomActivities
{
[Microsoft.TeamFoundation.Build.Client.BuildActivity(Microsoft.TeamFoundation.Build.Client.HostEnvironmentOption.All)]
partial class Ndepend
{
}
}

Tuesday, December 13, 2011

QFEs and Hotfix Rollup Package for Microsoft Test Manager 2010

If you are using Microsoft Test Manager, this post is for you.

It’s a good idea to check if you have all the hotfixes and updates installed.These updates contains features like:

  • Multi-line support for editing test cases in Microsoft Test Manager
  • Reduce the size of test data saved to the TFS Database
  • Performance improvements for loading automated test cases from a build-drop path
  • Performance improvements for publishing test results on a test suite that contains thousands of test cases in Test Manager

I recommend to have a look at the full list of updates(QFEs for Microsoft Test Manager 2010) and download them if one or more are missing.

Monday, December 12, 2011

Team Foundation Services Update

Last week Microsoft releases the first Team Foundation Services update that introduces some significant new functionality. Normally all features we’ll see are also going to be part of the new TFS 11.

So what’s new?

  • Redone navigation model to add a bit more style, rework administration mode and more.

NewNav

  • Enhanced homepages for teams and team projects to make them more interactive and intuitive.

homepage graphics

  • Simplified Web UI for Small Teams
  • Improved performance
  • E-mail Notifications and a new UI for managing subscriptions.

image

  • Forecast Lines to project where your iteration boundaries are likely to fall based on your team’s velocity and the estimates on your product backlog items.

forecast lines

  • In-Tile Taskboard Editing on the taskboard.

on-tile editing

Read the official announcement and all the details here: http://blogs.msdn.com/b/visualstudioalm/archive/2011/12/08/team-foundation-service-december-update.aspx

Friday, December 9, 2011

Microsoft Patterns & Practices Roadmap

Interested in what the Microsoft Patterns & Practices has in the pipeline for us? Have a look at their roadmap. I’m especially looking forward to the Windows 8 Guidance and the CQRS guide.

More information here: http://msdn.microsoft.com/en-us/practices/bb232643

Thursday, December 8, 2011

Clean up your development PC

Maybe you didn’t notice it yet, but Visual Studio leaves tons of temporary files all over your hard drive. This is why, over time, your computer loses hard disk space. Same thing for Windows updates, fixes, etc…

As I was running out of disk space I was looking for some ways to free some space. I found two very useful links that saved me a lot of disk space:

Tuesday, December 6, 2011

Unlocalize.com: Translate localized error messages

If you are working on a non-English OS, you probably have seen it: these localized error messages. Very useful for the end user but very annoying for us developers who want to google or bing for this specific problem. And while searching for an English error message gives you thousands of hits, you only get a few when you use the localized error message as the search term.

Last week I got the following tip from a colleague: Unlocalize.com, a very useful website which allows you to translate your localized error messages back to English. It’s even available as a browser plugin for your favorite browser.

A must have for every developer!

image

Monday, December 5, 2011

TFS Build: Build by label

By Default Team Foundation Build services allows you to build your solutions either based on the latest version available or on a combination of the latest version and a specific shelveset.

But what if you want to build a labeled version of your code?

You can specify a Label in the GetVersion parameter in the Queue new Build Wizard, going to the Parameters tab (for labels add the “L” prefix):

image

Friday, December 2, 2011

Integrate NuGet in your build process: TFS NuGetter

Although it’s not that hard to integrate NuGet in your build process, it can always be easier.

NuGettter is an extension to the Team Foundation Server 2010 build process that will perform all of the necessary versioning, packaging and deployment functions in a customizable and completely repeatable way.

Capabilities/Features:

  • Includes all phases of the build process: compile, version, pre-package, package, push/deploy and publish - managed within TFS 2010 automated build
  • NuGet Package and deploy features for a simple to an extremely complex library package
  • Single or multiple solution builds
  • Single or multiple configuration builds
  • Manage versioning of the assemblies coordinated or separately from the NuGet package
  • Create a package, create and push a package or create a package and push and publish to a NuGet gallery
  • Build and have immediate access to the package in a test environment through inherent "Push/Deploy" feature
  • Push locations include the NuGet Gallery, a local directory, network share or web site
  • Use in any combination of manual, continuous integration or scheduled builds
  • Ability to execute PowerShell scripts prior to packaging to organize the files (e.g., lib, tools, content) for the NuGet packaging process (pre-packaging)
  • No requirement for NuGet.exe to be installed on the build machine – NuGet.exe can be held in source control and deployed only at the time of the build
  • All of the above is managed through the standard TFS Build Workflow process
  • Remotely store/manage package information such as version numbers, API keys, and NuSpec manifest files
  • All of this is managed via a Team Foundation Server automated build process
  • Includes updated build process template "NuGetterVersioningBuildTemplate15.xaml" to work with the TfsVersioning v1.5 extended versioning capabilities.

NuGetter Build Process:

NuGetter Build Process

Build Definition Sample:

NuGetter Build Definition Example

Thursday, December 1, 2011

JavaScript Unit Testing in Visual Studio: Chutzpah 1.3 released

A new version of Chutzpah is now live on Visual Studio Gallery, CodePlex and now NuGet.

This release contains the following changes:

Features

1. Chutzpah is now able to run Jasmine tests in addition to QUnit.

2. Added a new configuration option to set the timeout on a test file.

Official announcement here: http://matthewmanela.com/blog/chutzpah-1-3-0-released/

Wednesday, November 30, 2011

Unity IsRegistered throws exceptions when registering Open Generic types.

For a long time, I had a very annoying error message when I called the IsRegistered method on the Unity container.

Error Message:
System.ArgumentException: GenericArguments[0], 'T', on 'Infrastructure.Data.NHibernateRepository`1[T]' violates the constraint of t
ype 'T'. ---> System.TypeLoadException: GenericArguments[0], 'T', on 'Infrastructure.Data.NHibernateRepository`1[T]' violates the c
onstraint of type parameter 'T'.

Last week I finally found the root cause of this issue. Let’s have a look at my code first:

public interface IRepository<T> where T:Entity
{

}

public class NHibernateRepository<T> : IRepository<T> where T : Entity, new()
{

}



So what’s causing the issue? Have a look at the generic constraints. You see that my interface is less restrictive than my implementation and that is what makes Unity chokes...



One workaround(which is still far from ideal) is that you can apply the same type constraints to the interface. Another (better) workaround is posted by Walter Almeida. Either way I hope it will be solved in the next release of Unity…

Tuesday, November 29, 2011

Creating test data using ElasticObject

For a recent project I had to write a lot of data-oriented tests. This required me to populate the domain model with lot’s of test data. Having to write a lot of new statements and property setters, I was looking for a cleaner alternative when I stumbled over this library: ElasticObject - An expandable dynamic object for .NET 4.0.

A dynamic ElasticObject implementation using .NET 4.0 dynamic features, for fluent access of data types like XML - Access XML <entry name="user"/> via fluent dynamic wrappers, like var n=entry.name; - You can also use it like ExpandoObject, with multi level property support
To start with, here are few scenarios you can use ElasticObject

  • An easier, fluid way to work with data formats – like XML and JSON. Presently, we’ve some support for XML.
  • Cleaner code though it is duck typed
  • A hierarchical way to maintain loosely typed data.

I used it to create a whole object hierarchy in a very simple way, like this:

image

Read More:

Monday, November 28, 2011

Visual Studio cannot start debugging because the debug target is missing

Sometimes you lose a lot of time finding the most idiot problems. Last week I had to do a code review so I downloaded the solution from Team Foundation Service and opened it. First I wanted to try to run the application but it failed with the following error message:


“Visual Studio cannot start debugging because the debug target 'D:\dev\ApplicationToReview\bin\Debug\ApplicationToReview.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly.”

Ok. So I rebuild the project a few times, had a look at the output folders only to see that the required assembly was definitely there. In the end I noticed that although the current project was set as the start up project but it was not configured to run in the Configuration Manager.

After checking the project under configuration manager everything worked fine.

Friday, November 25, 2011

Adobe Flex/Flash versus Microsoft Silverlight. And the winner is… HTML 5!

The last weeks there were some rumors that Silverlight 5 might just be the last version of the technology. Combine this with the fact that Adobe is  killing any further development of it's flash mobile plugin and you can only conclude that both Microsoft and Adobe think that the future of web development does not lie in a proprietary plugin technology, but in HTML5.

Flash has long been the standard bearer of richer experiences inside browsers. I’ve always had the feeling that Microsoft only created Silverlight to get a piece of this cake. (Maybe someone still remembers that Silverlight version 1 was based on JavaScript?!). Although I have to admit that Silverlight showed some real potential and allowed to create stunning user experiences , far better than I had ever even seen imagined with Flash. And now that Adobe is refocusing it’s effort to HTML 5, Microsoft no longer cares and I’m guessing that Silverlight 6 will never see the light.

But what about the Windows Phone than you could ask?

It’s all based on Silverlight so it will not disappear right? Even there I think we’ll see Silverlight replaced by a new WinRT alternative(just by guessing that Windows Phone 8 will have the same version number as Windows 8 Smile).

Should you care as a WPF/Silverlight developer?

No. One XAML framework will be replaced by another. And as long as the tooling for HTML 5 doesn’t keep up, we’ll remain far more productive in XAML development (without even talking about the technical expertise required to build an enterprise level business application, and no that’s not the same as a web application enhanced with some JavaScript here and there…). However in a future were HTML5 will become more and more important, it’s not wise to place all your eggs in one basket.

Should you care as a Mobile developer?

Although a native experience remains the ideal, I don’t see a world where every application will be written for each and every mobile platform. So I think the future of mobile is HTML5 and mobile web applications. For now, there are a few restrictions, but if you know about the device APIs you should realize those few limitations are going away in the near future.

So the safest guess today as a developer is to spend time learning HTML5 and JavaScript and you are ready to build rich user experiences for Web, Windows AND Mobile.

I know how I’ll spend my time the upcoming months…

Thursday, November 24, 2011

Mobile website vs Mobile application

With Mobile being the new hype everyone wants to build web application. But should I build a native Mobile application or is it better to build a mobile version of my web application?

HeadScape released this nice info graphic helping you in answering this question:

Wednesday, November 23, 2011

Web.config Transformation Tester

When you deploy a Web site, you often want some settings in the deployed application's Web.config file to be different from the development Web.config file. For example, you might want to disable debug options and change connection strings so that they point to different databases. Starting from Visual Studio 2010, ASP.NET provides tools that automate the process of changing (transforming) Web.config files when they are deployed. For each environment that you want to deploy to, you create a transform file that specifies only the differences between the original Web.config file and the deployed Web.config file for that environment.

A transform file is an XML file that specifies how the Web.config file should be changed when it is deployed. Transformation actions are specified by using XML attributes that are defined in the XML-Document-Transform namespace, which is mapped to the xdt prefix. The XML-Document-Transform namespace defines two attributes: Locator and Transform. The Locator attribute specifies the Web.config element or set of elements that you want to change in some way. The Transform attribute specifies what you want to do to the elements that the Locator attribute finds.

More information about creating a transformation file here and about the syntax here.

Last week I discovered the Web.config Transformation Tester, a simple web tool that allows you to test your transformations in a very easy way. It allows you to paste your web.config into the top text box and your transform into the second one. Click the 'Transform' button to see the result of the transformation.

image

Tuesday, November 22, 2011

Windows Azure Updates: SDK 1.6 and Training Kit November 2011 update released

And there is Microsoft again with 3 new updates for Windows Azure—a new version of the Windows Azure SDK, a new Windows Azure HPC Scheduler SDK, and an updated Windows Azure Platform Training Kit. 

 

Highlights:

  • Windows Azure SDK (November 2011)—Multiple updates to the Windows Azure Tools for Visual Studio 2010 that simplify development, deployment, and management on Windows Azure. The full Windows Azure SDK can be downloaded via the Web Platform installer here.
  • Windows Azure HPC Scheduler SDK— Works in conjunction with the Windows Azure SDK and includes modules and features to author high performance computing (HPC) applications that use large amounts of compute resources in parallel to complete work.  The SDK is available here for download.
  • Windows Azure Platform Training Kit—Includes hands-on labs, demos, and presentations to help you learn how to build applications that use Windows Azure. Compatible with the new Windows Azure SDK and Windows Azure Tools for Visual Studio 2010. The training kit can be downloaded here.

Here are the details:

The Windows Azure SDK for .NET includes the following new features:

  • Windows Azure Tools for Visual Studio 2010
    • Streamlined publishing: This makes connecting your environment to Windows Azure much easier by providing a publish settings file for your account.  This allows you to configure all aspects of deployments, such as Remote Desktop (RDP), without ever leaving Visual Studio.  Simply use the Visual Studio publishing wizard to download the publish settings and import them into Visual Studio.  By default, publish will make use of in-place deployment upgrades for significantly faster application updates.
    • Multiple profiles: Your publish settings, build config, and cloud config choices will be stored in one or more publish profile MSBuild files. This makes it easy for you and your team to quickly change all of your environment settings. 
    • Team Build: The Windows Azure Tools for Visual Studio 2010 now offer MSBuild command-line support to package your application and pass in properties.  Additionally, they can be installed on a lighter-weight build machine without the requirement of Visual Studio being installed.
    • In-Place Updates: Visual Studio now allows you to make improved in-place updates to deployed services in Windows Azure. For more details visit http://blogs.msdn.com/b/windowsazure/archive/2011/10/19/announcing-improved-in-place-updates.aspx
    • Enhanced Publishing Wizard: Overhaul of publishing experience to sign-in, configure the deployment, and review the summary of changes
    • Automatic Credential Management Configuration: No longer need to manually create or manage a cert
    • Multiple Subscription Deployment Management: Makes it easier to use multiple Windows Azure subscriptions by selecting the subscription you want to use when publishing within Visual Studio.
    • Hosted Service Creation: Create new hosted services within Visual Studio, without having to visit the Windows Azure Portal.
    • Storage Accounts: Create and configure appropriate storage accounts within Visual Studio (no longer need to do this manually)
    • Remote Desktop Workflow: Enable by clicking a checkbox and providing a username/password – no need to create or upload a cert
    • Deployment Configurations: Manage multiple deployment environment configurations
    • Azure Activity Log: More information about the publish and virtual machine initialization status

For more information on Windows Azure Tools for Visual Studio 2010, see What’s New in the Windows Azure Tools.

  • Windows Azure Libraries for .NET 1.6
    • Service Bus & Caching: Service Bus and caching client libraries from the previous Windows Azure AppFabric SDK have now been updated and incorporated into the Windows Azure Libraries for .NET to simplify the development experience.
    • Queues:
      • Support for UpdateMessage method (for updating queue message contents and invisibility timeout)
      • New overload for AddMessage that provides the ability to make a message invisible until a future time
      • The size limit of a message is raised from 8KB to 64KB
      • Get/Set Service Settings for setting the analytics service settings
  • Windows Azure Emulator
    • Performance improvements to compute & storage emulators.

Click here to download the Windows Azure SDK via the Web Platform Installer.

The Windows Azure Training Kit November 2011 includes the following updates:

  • [New demo] Publishing Cloud Applications with Visual Studio
  • [Updated] Labs and Demos to leverage the new Window Azure SDK & Tools 1.6
  • [Updated] SQL Azure Presentations
  • Applied several minor fixes in content

Click here to download the Training Kit via the Web Platform Installer.

Monday, November 21, 2011

.NET Framework 4.5–New features overview

You want to get an idea of all the new features in .NET Framework 4.5? Have a look at this nice poster created by Jouni Heikniemi.

Friday, November 18, 2011

Showing the ‘Runas’ option in the context menu

Just a simple reminder for something that I always seem to forget:

In Windows you can run the ‘Runas’ command/ This allows you to run a program as if it was running from a different user account on your computer while you are still logged on to your user account.

  • Press and hold the Shift key and right click on the program's shortcut or EXE file, then click on Run as different user. (See screenshot below)

image

  • Type in the user name and password of the user account that you want to run this program as. (see screenshot below)
    NOTE: If the user account is on a domain, then you would use UserName@Domain or Domain\UserName for the user name instead.

Thursday, November 17, 2011

TFS 2010: TF203028 and TF203071 branching errors

TF203028: You cannot create a branch at {path} because a branch already exists at {sub path}.

You see this message when a branch root exists at a sub path of the folder you are trying to mark as a branch root.

In the case a sub-folder was incorrectly marked as a branch root, you can recover easily from this by converting the branch root back to a folder , from the File->Source Control->Branching & Merging->Convert to Folder menu.

TF203071: The operation cannot be completed because the source folder that you specified contains a branch. If you want to perform this operation on the branch, then you must specify {path} as the source of the operation.

This occurs when you try to create a branch from a folder and there is a “branch roots” below this.

The reason for this restriction is consider the scenario, I have the following tree structure:

$/proj/MyProduct/Branches – regular folder

$/proj/MyProduct/Branches/v1.1 – regular folder

$/proj/MyProduct/Branches/v1.1/Dev - branch root

$/proj/MyProduct/Branches/v1.1/Test - branch root, related to Dev

$/proj/MyProduct/Branches/v1.1/Release - branch root, related to Test.

Users were branching v1.1 to v1.2, hoping that the relationship between Dev->Test->Release is maintained. However the relationship being established ends up being:

$/proj/MyProduct/Branches/v1.1/Dev -> $/proj/MyProduct/Branches/v1.2/Dev

$/proj/MyProduct/Branches/v1.1/Test –> $/proj/MyProduct/Branches/v1.2/Test

$/proj/MyProduct/Branches/v1.1/Release –>$/proj/MyProduct/Branches/v1.2/Release

To prevent users from making this assumption, we have the restriction. If you hit this message, you have a choice:

a. You are in the scenario described above, in that case you can setup your branches by branching $/proj/MyProduct/Branches/v1.1/Dev -> $/proj/MyProduct/Branches/v1.2/Dev and then branching -> $/proj/MyProduct/Branches/v1.2/Dev -> $/proj/MyProduct/Branches/v1.2/Test ->$/proj/MyProduct/Branches/v1.2/Release

b. If you still want to proceed with the operation (this is likely because $/proj/MyProduct/Branches/v1.1/Dev was incorrectly marked as a branch root). You can do so by converting the “branch root” back to a folder, from the File->Source Control->Branching & Merging->Convert to Folder menu.

Wednesday, November 16, 2011

TFS 2010: Cube processing failed

At a customer, we had some problems with the TFS Datawarehouse cube no longer being processed. When looking at the logs, I noticed the following error message:

<LastRun QueueTimeUtc="2011-11-10T13:15:59.497Z" ExecutionStartTimeUtc="2011-11-10T13:16:00.517Z" EndTimeUtc="2011-11-10T13:18:00.637Z" Result="Blocked">

<ResultMessage>[Version Control Warehouse Sync]: ---> MakeDataChanges() result=DataChangesPending. ---> TF221033: Job failed to acquire a lock using lock mode Shared, resource DataSync: [TFSDB].[Tfs_Warehouse] and timeout 30.</ResultMessage>

</LastRun>

Some useful links to solve this problem:

Our solution:
  • Go to the warehouse control service, which in our case is at: http://tfs:8080/tfs/TeamFoundation/Administration/v3.0/warehousecontrolservice.asmx
  • From there click on the SetWarehouseJobEnabledState operation. In here you'll see that you can specify the collection, the job, and what state to put it in.
  • If you want to know the list of jobs, you can run the GetProcessingStatus operation from the warehouse control service.
  • Set all jobs to FullyDisabled.
  • Then set one to Enabled and process the warehouse using the ProcessWarehouse link on the warehouse control service page.

Tuesday, November 15, 2011

TFS 2010: Administrative reports

After blogging about 2 administrative reports some time ago, I have a new list with useful reports for the TFS administrator.

Microsoft released some reports that visualize the information that TFS stores about the health of the data warehouse.

These reports are useful to TFS administrators, operations/support teams, project administrators & end-users. The reports in this pack display the following kinds of information:

  • Recent processing times
  • Current status (whether the cube is processing now and, if not, when it is scheduled to process next)
  • Schema conflicts
  • Most recent time that each adapter successfully ran
Interpreting the reports

In the download, there is a FAQ document which includes screenshots of what different reports mean and common questions. The contents of the FAQ are also available at Monitoring the TFS Data Warehouse – FAQ.

Requirements
  • SQL Server Reporting Services 2008 or 2008 R2
  • A shared datasource to which you connect the report, as the installation instructions describe how to configure.
Download: AdminReportPack.zip

Download and install this report pack to the Team Foundation Server Reporting Services Instance to monitor warehouse and cube processing status.

For information about how to install this report pack, see Installing Admin Report Pack for TFS.docx that is included in the download.

The pack includes:

  • Admin Report Pack for TFS FAQ.docx
  • Installing Admin Report Pack for TFS.docx
  • Reports\Cube Status.rdl
  • Reports\Blocked Fields.rdl
  • Reports\Reportable Fields.rdl

Here’s an overview of how the reports look and what questions you can answer with them.

More information and the original post: http://blogs.msdn.com/b/granth/archive/2010/07/12/administrative-report-pack-for-team-foundation-server-2010.aspx

Monday, November 14, 2011

Attempt by security transparent method to access security critical method

Last week I was spending some time integrating the Microsoft Enterprise Library Data Access Application Block with the MVC Mini Profiler.

After overriding some methods, I was ready to run my first test. But instead of getting some profiling results all I got was the following error message:

“Attempt by security transparent method 'Microsoft.Practices.EnterpriseLibrary.Data.Database.CreateConnection()' to access security critical method 'MvcMiniProfiler.MiniProfiler.get_Current()' failed.”

So why did I got this error and what does it mean?

Let me first tell you that the Enterprise Library assembly is marked with the AllowPartiallyTrustedCallersAttribute and uses the level 2 security transparency model.  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default.

In .Net4.0 framework, security tranparency rules prevent any security transparent code to call into security critical code. In .Net4.0 default security transpareny of library assemblies is security critical. The Enterprise Library assembly is marked with AllowPartiallyTrustedCallers attribute. This explicitly tells the security framework that this library will accept calls from security transparent callers. But the assembly MvcMiniProfiler do not have AllowPartiallyTrustedCallers attribute on it. This means it will not allow partial trusted or untrusted code to call into it.

I solved the problem by forking the MvcMiniProfiler code and adding the AllowPartiallyTrustedCallers attribute on the assembly. Anyone who knows a better(read=more secure) alternative?

Friday, November 11, 2011

Windows Azure Training Kit: October 2011 release

And there is the Azure team again…

The October release of the Windows Azure Platform Training Kit (WAPTK) is now available as a free download. Download the full training kit including the hands-on labs, demo scripts, and presentations here. Browse through the individual hands-on labs on MSDN here.

The October 2011 version of the training kit includes the following new and updated content:

  • HOL: SQL Azure Data-tier Applications NEW
  • HOL: SQL Azure Data Sync NEW
  • HOL: SQL Azure Federations NEW
  • DEMO: Provisioning Logical Servers using Cmdlets NEW
  • DEMO: Parallel Computing on Windows Azure - Travelling Salesman NEW
  • SQL Azure Labs and Demos with the new portal and tooling experience UPDATED
  • Applied several minor fixes in content UPDATED

For more information about the new SQL Azure content, including the new HOLs, please refer to the blog post, “New and Updated SQL Azure Labs Available”, just posted to Roger Doherty’s blog.

Thursday, November 10, 2011

Waterfall project management was a mistake

Last week I was reading the ‘Are project managers living a lie?’ blog post by Peter Saddington, when I noticed the following eye-opening paragraph:

“It has always been eye-opening to many people when I tell my workshop participants or clients that they old waterfall way of doing software was never intended to be used. It was a misinterpretation of Dr. Royce’s seminal paper. What happened was that government agencies read the first page, saw a diagram (with a poorly chosen caption), and said: “Hey, that’s how we do software development!

Yes, that’s right. Waterfall project management was never the point. It was actually iterative development that Dr. Winston Royce was pointing to… later in his paper.

If they had read the second page of Dr. Royce’s paper, they would have found the following quotes:

“I believe in this concept, but the implementation described above is risky and invites failure.”

“Yet if these phenomena fail to satisfy the various external constraints, then invariably a major redesign is required.”

“The required design changes are likely to be so disruptive that the software requirements upon which the design is based and which provides the rationale for everything are violated. Either the requirements must be modified, or a substantial change in the design is required. In effect the development process has returned to the origin and one can expect up to a 100-percent overrun in schedule and/or costs.”

It’s kind of sad that the most used Project Management technology today is based on a misinterpretation of a paper. I hope that some (project) managers will read this paper and maybe even start thinking about how they are managing their projects today… (and yes, I’m also talking about the ‘Scrum but…’ adepts!)

Waterfall Managing the Development of Large Software Systems Royce

Wednesday, November 9, 2011

Visual Studio 2010: NUnit support

Microsoft announced full support for NUnit and other Testing frameworks in Visual Studio 11. However today you still don’t have NUnit integration out-of-the-box. Of course you can use the Resharper plugin or TestDriven.NET but these are not free(although worth every cent). Last week I discovered Visual Nunit, a free alternative to run your NUnit tests inside Visual Studio.

 Visual Nunit is an open source NUnit runner for Visual Studio 2010. It provides convenient view to test cases and enables debugging (red arrow) tests easily inside development environment. It does not require separate test project. Implemented as Visual Studio Integration Package.

Features:
  • Easy test debugging
  • Easy and fast NUnit test execution
  • NET 2.0, 3.0, 3.5 and 4.0 support
  • Test execution progress, time and summary
  • Stack trace view
  • Test filtering based on project, namespace and fixture

Visual Nunit 2010

Tuesday, November 8, 2011

JavaScript Patterns: Settings object

One of the patterns you see a lot in jQuery and other JavaScript based framework is the use of a Settings object to pass configuration data to a module or function.
Again without spending too much words, a short sample:
(function ($) {
      $.fn.blink = function (options) {
      var settings = {
     'speed': 'fast', 
    'repeat': 3
        };
        //if the options isn’t null extend defaults with user options.
        if ( options ) { 
        $.extend( settings, options );
        }

        for(var i = 0;i<settings.repeat;i++)
        {
      this.fadeOut(settings.speed);
      this.fadeIn(settings.speed);
        }
      }
})(jQuery);


This is a function from a jQuery plugin(can’t remember the exact name). But the important things to notice here are:
  1. The blink method allows you to pass an options object.
     
  2. Inside the blink method a settings object is created with some default settings.
     
  3. If the user specified the options object, it will override one or more defaults by using the ‘extend’ method.
Learn it, love it…

Monday, November 7, 2011

IBM Rational to Team Foundation Server Integration Tools - Training and Exploration Sandbox

While I’m busy working on a IBM Rational ClearCase to Team Foundation Server migration, I discovered that the ALM rangers have provided an evaluation and training sandbox. It offers an easy to use and near-zero-admin exploration, training and testing environment for IBM Rational ClearCase and/or IBM Rational ClearQuest migrations to Team Foundation Server, based on the latest supported Team Foundation Server Integration Tools.

Supported scenario’s

Some of the supported scenario’s in this environment are:

  • IBM Rational ClearCase to Team Foundation Server migration
  • IBM Rational ClearQuest to Team Foundation Server migration
  • Team Foundation Server to Team Foundation Server migration
How do you get started?
  • Access the sandbox in three steps:
    1. Register at teamdevcentral.com
    2. Check your e-mail
    3. Connect using RDC over the Internet as per received instructions

More information here.

Friday, November 4, 2011

Telerik MVC Grid: Client Side filtering

One of the nice features of the Telerik MVC Grid is filtering. What makes this even cooler is that you can easily add your own filters using the client side API.
An example:
$(function () {
    var button = $("#filterButton");

    var filtered = false;

    button.click(function (e) {
        e.preventDefault();
        var grid = $("#ordersGrid").data('tGrid');

        if (filtered === false) {
            button.html('Remove filter');
            filtered = true;
   //Add filter
            grid.filter("OrderID~eq~10255");
        }
        else {
            button.html('Add filter');
            filtered = false;
   //Remove filter
            grid.filter('');
        }

        alert("clicked");
    });
});


Remark: Unfortunately this only seems to work when operationmode of the grid is not changed to GridOperationMode.Client.

Thursday, November 3, 2011

Javascript Patterns: The Module pattern

There are a lot of different ways to structure your Javascript code (and the most popular one remains no structure at all Glimlach). One of the most used patterns out there is the Module pattern. Instead of giving you a long explanation, let me show you a short sample:
var module=(function(){
 var helloText='Hello world'
 
 function sayHello(){
  alert(helloText);
 }

 return { sayHello: sayHello}; 
})();

module.sayHello(); 

What’s happening inside this code?
  1. I create a JavaScript function that I immediately invoke. The result is assigned to the variable ‘module’.
     
  2. Inside this function I create a variable called ‘helloText’. As JavaScript uses function scope instead of block scope, this variable is available everywhere inside this function but not outside of it.
     
  3. I add a function ‘sayHello’, this function is also only accessible inside the ‘Module’ function.
     
  4. As a last step I create a new JavaScript object with a function sayHello on it that refers to the internal ‘sayHello’ function I’ve just created. This object is then returned. When I immediately invoked the function in step 1 I got the object back we’ve created with one public function ‘sayHello’.
By following this Module pattern, I can create nicely scoped functions and variables without fear for naming conflicts and without polluting the global scope.


Learn it, love it…

Wednesday, November 2, 2011

Bug in Telerik MVC Grid Control: Displaying items 1 - NaN of undefined

After starting a project with the jqGrid control, we decided to move to the Telerik MVC Grid control. Although a very powerful control, some advanced scenario’s were just too painful to implement with the jqGrid. So we replaced the jqGrid control with the Telerik MVC Grid control and were really happy with the result(we were able to get the same functionality with half the amount of code).

However it still has some rough edges here and there. One error we got was when our grid control was bound to an empty list, the following text was shown in the pager part: ‘Displaying items 1 - NaN of undefined’. This issue is mentioned on the Telerik MVC forums and a bug fix is available here.

UPDATE: Last week Telerik released their first beta of the Q3 2011 version of the Telerik MVC controls. I validated the beta and it seems that the issue is no longer there. Great job Telerik!

overview-sprite

Monday, October 31, 2011

OData Service for Team Foundation Server 2010 - v1

A few months ago Microsoft released the beta of the OData Service for Team Foundation Server 2010. Last week they finally  announced that v1 of this service is now available and you can download it here.

What is it?
The purpose of this project is to help developers work with data from Team Foundation Server on multiple device types (such as smartphones and tablets) and operating systems. OData provides a great solution for this goal, and has been embraced by numerous developers for building great device-specific applications. OData is accessible from any device and application stack which supports HTTP requests. This OData service interacts directly with the TFS client object model.

Check out Brian Keller’s post for more information.

Friday, October 28, 2011

Visual Studio Troubles: The project file has been moved, renamed or is not on your computer

After doing a rename and merging a solution inside Visual Studio(one tip: never try to combine these two things at the same time), one project don’t want to load anymore. Instead I always got the following error:

“The project file has been moved, renamed or is not on your computer.”

I tried a lot of stuff but in the end the following solution worked:

  1. Close Visual Studio.
  2. Browse to the solution folder of the project which is giving you problems.
  3. Find the .suo file and delete it.
  4. Reopen your solution. Visual Studio will recreate the .suo file and everything worked.

Thursday, October 27, 2011

Visual Studio 2010 Feature Pack 2

Between all the fuzz about Windows 8 and Visual Studio 11, you should almost forget that we still have a long way to go with Visual Studio 2010.

Microsoft extended the rich feature set of VS by releasing the second Visual Studio 2010 Feature Pack. This Feature Pack has following features :-

  • Testing features:
    • Playback tests using the Mozilla Firefox browser. You can use Windows Internet Explorer 7 (or later versions) to record UI actions on a website or a Web-based application and then play back the tests using the Mozilla Firefox browser version 3.5 and 3.6.

    • Edit coded UI tests using the Coded UI Test Editor. The editor lets you easily modify your coded UI tests. You can locate, view, and edit your test methods, UI actions and their associated controls in the UI control map.

    • You can create coded UI tests or action recordings for Silverlight 4 applications. Action recordings enable you to fast forward through steps in a manual test.

  • Code visualization and modeling features:
    • Use the Generate Code command to generate skeleton code from elements on UML class diagrams. You can use the default transformations, or you can write custom transformations to translate UML types into code.

    • Create UML class diagrams from existing code.

    • Explore the organization and relationships in C, C++, and ASP.NET projects by generating dependency graphs.

    • Import elements from UML sequence diagrams, class diagrams, and use case diagrams as XMI 2.1 files that are exported from other modeling tools.

    • Create links and view links from work items to model elements.

    • Create layer diagrams from C or C++ code and validate dependencies.

    • Write code to modify layer diagrams and to validate code against layer diagrams.

Remark: This package is only available for MSDN subscribers.

Wednesday, October 26, 2011

Visual Studio 11 Developer Preview Training Kit October 2011 Release

Microsoft released their first Training Kit for the upcoming Visual Studio 11.

“The Visual Studio 11 Developer Preview Training Kit includes hands-on labs to help you understand how to take advantage of the variety of enhancements in Visual Studio 11 and the .NET Framework 4.5, how to support and manage the entire application lifecycle and how to build Windows Metro style apps.”

Instructions

There are two files you can download to install this Training Kit:

  • The file VS11TrainingKitOctober2011.Setup.exe will install the entire training kit, After downloading this file, you do not need an Internet connection to install the files. Download and launch the self-extracting package. The Training Kit will uncompress to the selected folder and launch a HTML browser for the content.
  • The file VS11TK_WebInstaller_Preview.exe provides you with the ability to install all or only some of the training kit. Download and launch the self-extracting package. Then select the labs you wish to install. You can rerun the installer to add labs in the future. This installer requires an Internet connection.

Download link: http://www.microsoft.com/download/en/details.aspx?id=27738

[SNAGHTML1ed07198%255B4%255D.png]

Tuesday, October 25, 2011

Compiler as a service: Project Roslyn

Microsoft announced the availability of the Roslyn CTP last week.

This release marks a significant step to the new way of thinking of compilers, and the agility that is now possible with language innovation, IDE tooling, and powering the ecosystem. The C# and VB compilers are no longer black boxes – something we put source text into, do some magic on, and get an assembly out. All that rich information about code is no longer thrown away, but is now exposed as a full-fidelity object model that can be easily consumed by all. In addition, it was released a preview of the first-ever Interactive window for C# that contains full IDE support – including IntelliSense and even automatically detecting missing using directives.

How to get started:

  • Download the CTP. The CTP installs on Visual Studio 2010 SP1 and can be safely installed side-by-side with Visual Studio 11.

  • Go to Start -> All Programs -> Microsoft Codename Roslyn CTP -> Getting Started to launch the entry point into all the documentation, samples, and tools.

  • Read the Roslyn Project Overview for a good overview of the project.

  • Learn from the rich samples included (paste as C#/VB, refactorings, code analysis, and code generation tools).

  • Run the walkthroughs to learn about the Compiler APIs, the Services API, or using the Interactive window.

  • For those of you that aren’t extension writers, download the CTP to try out the Interactive window and use the Copy Paste C#/VB extensions that were built to help with your daily work now!

The release includes the following features:

  • Visual Studio Project Templates
    These project templates help you get started using the Roslyn APIs and building new Visual Studio extensions using the C# or VB APIs.

  • Reference Assemblies
    The Roslyn assemblies can be added to projects via the Add Reference dialog.

  • Interactive Window
    A new tool window called C# Interactive is available in Visual Studio by invoking View -> Other Windows -> C# Interactive from the menu. You can explore by either executing snippets of code in the C# Interactive tool window, or cumulatively building up execution context as you experiment.

  • Script File Editing Support
    C# Script (.csx) files allow top-level statements much like the C# Interactive window. You can create a new C# Script file by invoking File -> New File -> Script -> Visual C# Script from the Visual Studio menu. In addition to typing directly into the tool window, you can also select code in C# and C# Script (.csx) files and invoke "Execute in Interactive" or "Copy to Interactive" from the context menu. C# Script editing features like IntelliSense are powered by the Roslyn Language Service.

Some Links:

Monday, October 24, 2011

Downloading an old version of a NuGet package

By default NuGet will always download the latest version of a package. But what if you don’t want the most reason version? Luckily there is a way to specify the package version by using the Package Manager Console in Visual Studio.
First bring up the Package Manager Console in Visual Studio. Go to Tools|Library Package Manager|Package Manager Console.
You can install a package by using the ‘Install-Package’ powershell command. This command has a Version argument that can be used to specify a specific version.
Install-Package PackageName -Version 1.3.1
See the command reference for details. If you use the Intellisense feature inside the Package Manager Console(by using the TAB key), you even get the list of available versions.

The same thing works if you want to update an existing package, this time by using the ‘Update-Package’ powershell command.

Update-Package PackageName -Version 1.3.2

Friday, October 21, 2011

The power of HTML 5 and Javascript: Rendering PDF’s in your browser

Today I was once again amazed about the power that HTML5 and Javascript can offer when I discovered PDF.js. This Javascript library is written by a couple of clever guys over at Mozilla and allows you to display PDFs inside your browser using Javascript and HTML5. The code is available for download on Github.
Benefits
The traditional approach to rendering PDFs in a browser is to use a native-code plugin, either Adobe’s own PDF Reader or other commercial renderers, or some open source alternative. From a security perspective, this enlarges the trusted code base and increases the risk of code based injection attacks. An HTML5-based implementation is completely immune to this class of problems.
If you want to see a demo of pdf.js, click on this link. There are still glitches and rendering artifacts but it already shows the potential of this library.
A quick sample
Download the latest code required from Github to start developing. Create a web page and embed the following Javascript references:
<script type="text/javascript" src="scripts/pdf.js"></script>  
<script type="text/javascript" src="scripts/metrics.js"></script>
<script type="text/javascript" src="scripts/fonts.js"></script>
<script type="text/javascript" src="scripts/glyphlist.js"></script>


Add the new <canvas> HTML5 control to the body of your page


<canvas id="pdf-canvas" style="border:1px solid black;"/>


Now you can start rendering your PDF by writing some Javascript code:
<script type="text/javascript">
'use strict';      
getPdf('myPDFFile.pdf', function getPdf(data) {
 // Instantiate PDFDoc with PDF data          
 var pdf = new PDFDoc(data);          
 var page = pdf.getPage(1);          
 var scale = 1.5;

 // Prepare canvas using PDF page dimensions          
 var canvas = document.getElementById('pdf-canvas');
 var context = canvas.getContext('2d');
 canvas.height = page.height * scale;
 canvas.width = page.width * scale;          
 
 // Render PDF page into canvas context
 page.startRendering(context);      
});  
</script>

Thursday, October 20, 2011

Enterprise Library: Windows Azure Autoscaling application block

Last week Microsoft released a beta version of the  Windows Azure Autoscaling Application Block.To learn more about this application block watch the video walkthrough:

The easiest way to download the block is via NuGet. There are two packages – one with binaries and one containing the source. The beta includes a sample application for hosting the block and for exploratory testing.

This version offers a lot of new features as well as bug fixes. Check this page for the change log.

Getting Started

Please follow the instructions in the included Readme file to learn how to use the block binaries and about the pre-requisites if you want to build the block from source. They also released a first draft set of documentation, which includes the reference documentation and an early preview of the Developer’s Guide. Both are available via Codeplex.

There is also a sample app that showcases various usages of the Autoscaling Application Block. Therefore they expanded the scope of the Tailspin reference implementation originally shipped with the Developing Application for the Cloud Guide by making it more elastic. The sample app is also available via Codeplex.

Wednesday, October 19, 2011

Team Foundation Server Source Control Explorer VS 2010 Extension

TFSSCExplorerExtension is a Visual Studio 2010 Extension Package that adds new functionality to the TFS Source Control Explorer window. Most important features are Drag & Drop support, Move and Branch functions even for multiple files selection and Merge from Sources feature.

image

There is a version available both for Visual Studio 2010 and Visual Studio 11 Developer Preview:

Tuesday, October 18, 2011

Telerik MVC Extensions: Using a more recent jQuery version

If you are looking for custom ASP.NET MVC controls, the Telerik MVC Extensions are one of the options. If you are using them you probably included them in your ASP.NET MVC web application by using NuGet. These extension are jQuery based and jQuery 1.5.1 is included out of the box.
Including the required Javascript files is easy. Just at the following code to the bottom of your Razor page(your Telerik controls should be placed BEFORE the scripts).
@(Html.Telerik().ScriptRegistrar()) 

This will include jQuery and all other required Javascript files automatically. But what if you are using a more recent jQuery version? I first removed the jQuery script from the Scripts\2011.2.712\ folder but this resulted in errors. Instead what you need to do is change your script as follows:


@(Html.Telerik().ScriptRegistrar() 
   .jQuery(false) 
) 

The ScriptRegistrar will no longer complain and you can reference the jQuery version of your choice. I tried it with jQuery 1.6.2 and everything worked fine.

Monday, October 17, 2011

Running your build server on Azure

With the first preview of TFS Services(read: Team Foundation Server on Azure), you’re ALM environment in the cloud get’s a lot closer.

But what about my build server? Do I still need to host some servers myself or is their an alternative available?

Although not an official solution (yet), one of the options you have is using an Azure VM Role with a build service, and configure it against your TFS Services instance.

What’s needed to get this working?

First of all you need a Windows Azure account of course. Login to the Windows Azure portal(http://windows.azure.com) and sign up for the VM role beta program(yes it’s still in beta). It can take some time before your subscription is approved so be patient(it took a few weeks before our subscription was activated).

While you are waiting for your subscription approval you can already create the VHD required for your VM role. Follow the steps as described in the following post: http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_vmrolelab_topic2. Replace task 2 with the installation of TFS build Service 11 (Look here for the steps), but only do the installation and skip the configuration part. Replace Task3 and only change the port number in bullet 9 to 9191(This is the default one for the TFS Build Service).

After your subscription is activated you can upload the VHD to Windows Azure(on my slow ADSL connection it took me a few hours). As a final step use the Remote Desktop functionality to connect to the VM Role instance(More info here: http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_vmrolelab_topic3) and configure the build service according to the steps described by Brian Harry.

That’s it!

image

Thursday, October 13, 2011

TFS Build Error: The process cannot access the file 'data.coverage' because it is being used by another process

Last week we had a situation on our build server where the build was running indefinitely. After stopping the build, the following error was thrown:

The process cannot access the file 'data.coverage' because it is being used by another process.

As the problem only happened when code coverage was enabled, I guessed that it had to do something with the test runner. One thing I noticed on the build machine that the VSPerfmon.exe kept running.

After killing this process, the build completed and the issue was gone.

Customizing TFS Build 2010

If you are looking into TFS Build customizations, I can recommend starting with the following blog series by Ewald Hofman:

  1. Part 1: Introduction
  2. Part 2: Add arguments and variables
  3. Part 3: Use more complex arguments
  4. Part 4: Create your own activity
  5. Part 5: Increase AssemblyVersion
  6. Part 6: Use custom type for an argument
  7. Part 7: How is the custom assembly found
  8. Part 8: Send information to the build log
  9. Part 9: Impersonate activities (run under other credentials)
  10. Part 10: Include Version Number in the Build Number
  11. Part 11: Speed up opening my build process template
  12. Part 12: How to debug my custom activities
  13. Part 13: Get control over the Build Output
  14. Part 14: Execute a PowerShell script
  15. Part 15: Fail a build based on the exit code of a console application
  16. Part 16: Specify the relative reference path

Afterwards you can get into more detail by browsing through Jason Prickett’s blog at http://blogs.msdn.com/b/jpricket/.

Wednesday, October 12, 2011

Use Fiddler to validate version problems with Javascript libraries

I’m a big fan of Fiddler for a long time. Last week I had to test some jQuery compatibility issues with a new web application we were building. At first I was replacing all the Javascript files with newer versions, updating all the references and so on… Although this approach worked it was cumbersome and error-prone. Isn’t there a better alternative?
Fiddler to the rescue!
I found the following post by Eric Law where he uses Fiddler to load a different version of jQuery without updating any reference:http://blogs.msdn.com/b/ieinternals/archive/2011/08/19/using-fiddler-to-verify-a-jquery-update-will-fix-a-compatibility-problem.aspx.  Exactly where I was looking for!
So how can you do this?
  • First, download the (newer) version of the library you want to test.
  • Start Fiddler and go to the AutoResponder tab. Use the Add… button to create a new rule to map requests for your Javascript library to the newly downloaded file.image
  • Also set the Unmatched requests passthrough option to ensure that Fiddler doesn’t automatically generate 404s for requests that don’t match any of the rules.
  • Reload your web application you’ll see that  Fiddler intercepts the request for the older library and returns the newer one instead.
If I only found out this feature sooner…

Remark: Don't forget to remove this rule afterwards.

Tuesday, October 11, 2011

Developer cheat sheet

As a developer there are so many things you need to remember: keyboard shortcuts, programming language syntax, code snippets, … and the list keeps growing.

So make your life as a developer a little bit easier and use this ultimate cheat sheet at http://devcheatsheet.com/.

“DevCheatSheet.com is a directory of free cheat sheets and quick reference cards for developers, programmers, engineers, and nerds” 

Monday, October 10, 2011

NServiceBus Modeling Tools

If you are still not convinced that NServiceBus could make your message based architecture a lot simpler, maybe this new feature can convince you:

NServiceBus Modeling

“Visual Studio integrated modeling tools for NServiceBus allow you to graphically design your distributed solution and have all of your projects created, appropriate references set up, configuration of queues and routing made to "just work", on top of all the regular NServiceBus goodness.”

This first version includes Visual Studio integration and really makes developing with NServiceBus much more productive and enjoyable.

NServiceBus Modeling Tools for Visual Studio from NServiceBus Ltd. on Vimeo.

You can get this tool on the NServiceBus download page or via the Visual Studio Gallery here.

Friday, October 7, 2011

WPF is still alive!

With all the fuzz about the dead of Silverlight, we should almost forget that it still has a big brother WPF.

After the announcements at Build it looks like that WPF isn’t dead either. It even has some very useful new and enhanced features

  • Ribbon control: WPF 4.5 ships with a Ribbon control that hosts a Quick Access Toolbar, Application Menu, and tabs.
  • Improved performance when displaying large sets of grouped data
  • New features for the VirtualizingPanel
  • Binding to static properties: You can use static properties as the source of a data binding. The data binding engine recognizes when the property's value changes if a static event is raised.
  • Accessing collections on non-UI Threads: WPF enables you to access and modify data collections on threads other than the one that created the collection. This enables you to use a background thread to receive data from an external source, such as a database, and display the data on the UI thread. By using another thread to modify the collection, your user interface remains responsive to user interaction.
  • Synchronously and Asynchronously validating data: The INotifyDataErrorInfo interface enables data entity classes to implement custom validation rules and expose validation results asynchronously. This interface also supports custom error objects, multiple errors per property, cross-property errors, and entity-level errors.
  • Automatically updating the source of a data binding: If you use a data binding to update a data source, you can use the Delay property to specify an amount of time to pass after the property changes on the target before the source updates.
  • Binding to types that Implement ICustomTypeProvider
  • Retrieving data binding information from a binding expression
  • Checking for a valid DataContext object
  • Repositioning data as the data's values change (Live shaping): A collection of data can be grouped, sorted, or filtered. WPF 4.5 enables the data to be rearranged when the data is modified.
  • Integrating WPF with win32 Graphical User Interfaces(My favorite!): WPF 4.5 provides better integration between WPF and Win32 user interface components.
  • Improved Support for Establishing a Weak Reference to an Event: Implementing the weak event pattern is now easier because subscribers to events can participate in it without implementing an extra interface. The generic WeakEventManager class also enables subscribers to participate in the weak event pattern if a dedicated WeakEventManager does not exist for a certain event.
  • New methods for the Dispatcher class: The Dispatcher class defines new methods for synchronous and asynchronous operations.
  • Markup Extensions for Events: WPF 4.5 supports markup extensions for events. While WPF does not define a markup extension to be used for events, third parties are able to create a markup extension that can be used with events.

More information and all the details here: http://msdn.microsoft.com/en-us/library/bb613588(v=VS.110).aspx.