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.

Thursday, October 6, 2011

JBOWS: Just a Bunch of Web Services

Sometimes you know that something is an anti-pattern but you don’t find a good name for it. Last week I discovered the following old blog post about JBOWS. I immediately recognized this as something I had seen before in a lot of so called ‘SOA’ architectures. Unfortunately this anti-pattern still applies today.

JBOWS stands for Just a Bunch of Web Services and indicates a service oriented architecture that focuses on tooling and technology rather than architecture and analysis. Most of the time this happens because IT is leading the SOA initiative(instead of the business).  And SOA with little or no cooperation from the business is meant to fail. Therefore most JBOWS architectures deliver little or no value to the business. If anything, overall business agility will decrease over time as more and more disorganized services spring up with considerably more complex and brittle dependencies that need to be maintained.

So if you recognize this inside your own organization, know that it has a name Glimlach.

Wednesday, October 5, 2011

Brain meltdown: Practical Foundations for Programming Languages

Last week I found the following free programming book at http://www.cs.cmu.edu/~rwh/plbook/book.pdf  on "Practical Foundations for Programming Languages".

As the title states it focuses on the foundations of programming languages. The idea is that most  programming language features start from the concept of a type
structure that governs its syntax and semantics. Although very interesting to read, it almost cost me a brain meltdown.

Read at your own risk!

Tuesday, October 4, 2011

Scrum for Team System became Open Source

Crispin Parker, the original creater of the great Scrum for Team System template has left his company. Luckily for us he took the Scrum for Team System template with him and turned it into an open source initiative.  Let’s hope that this will bring the template to the next level.

So from now on if you are looking for a new version of the template, go to http://scrumforteamsystem.codeplex.com/.

BTW: Old versions are still available at http://www.scrumforteamsystem.co.uk/

Monday, October 3, 2011

Windows Azure Platform Training Kit – September 2011 Update

Earlier this month Microsoft released an updated version of the Windows Azure Platform Training Kit. The September 2011 update of the training kit includes updated hands-on labs for the Windows Azure SDK/Tools version 1.5 (September 2011.) The September update also includes a new hands-on lab for Service Bus Messaging, which demonstrates how to send and receive messages using the new Service Bus Message Queues and Topics that were just released.

You can download the full training kit including the hands-on labs, demo scripts, and presentations from the Microsoft download center here: http://bit.ly/WAPTKSept2011.

If you don’t want to download the complete training kit, you can try the new Windows Azure Platform Training Kit – Web Installer. This new training kit web installer is a very small application weighing in at 2MB. It enables you to select and download just the hands-on labs, demos, and presentations that you want instead of downloading the entire training kit. As new or updated hands-on labs, presentations, and demos are available they will automatically show up in the web installer – so you won’t have to download it again(and it has a nice Metro style UI).