Customized tasks in VSTS builds

The Microsoft Visual Studio Team Services (VSTS) have a totally new way of creating build definitions. There are many available tasks right out of the box. It offers tasks to build .NET code, build Xamarin apps, execute Grunt and Gulp tasks, do code analysis with SolarQube, integrate Jenkins jobs, publish NuGet packages, run cloud-based load tests, copy files to a machine, deploy a SQL database to Azure, publish a web app or cloud service to Azure, … It has also many utility tasks and there is a collection with free third-party tasks in the MarketPlace.

But when building your software, quite often you need custom steps. In this article I will cover some techniques how to customize the build process. I will show you how to implement PowerShell scripts, do logging and work with environment variables and arguments, how to load custom C# .NET assemblies and how to create extensions and upload them to VSTS.

Azure Management Libraries

Some months ago I was creating some tools at my work to automate the creation of branches in Team Foundation Server, together with namespaces, build definitions and Azure environments. To create and delete Azure clouds services, databases, storage, websites, services busses, … I used the Azure Management Libraries.

The Microsoft Azure Management Libraries (MAML) are a great collection of .NET NuGet packages which allow you to automate, deploy, and test cloud infrastructure easily. Each package provides client .NET classes for an individual area of the Windows Azure REST services. These classes provide a lot properties and methods which are fully await/async.

There are not that many examples and documentation on the internet yet. So I decided to write a simple article about it with a lot of C# examples. I hope the article can be useful to get started with the Azure Management Libraries.

ASP.NET WebAPI 2.2 REST services and Windows Integrated Authentication (WIA)

An detailed article about ASP.NET WebAPI 2.2 REST services and Windows Integrated Authentication (WIA) for intranets. How does it work and how to configure windows authentication in your .NET server project, in IIS (Express) and in the webbrowsers. And finally I will show some examples how to implement .NET and HTML/Javascript clients which consume the service.

Spatial Data in Entity Framework 5.0

In Entity Framework 5.0 spatial data types are supported so now we can create Linq queries to query nearby locations, calculate distances and check if locations intersect with an area. This articles demonstrates how to insert and update locations with latitude and longitude coordinates and how to query them in different ways.

Customize WCF RIA Services code generation

In March of this year SP1 of WCF RIA Services was released together with SP1 of Visual Studio 2010. Soon this was followed by a new version of the WCF RIA Services Toolkit. Microsoft has changed a few things in SP1 which makes it possible for you to implement you own code generation classes that can manipulate the client code generation of RIA Services entities, contexts, … In my opinion this is a great new feature which is very powerful when you are building your own Silverlight framework. So in this article I will describe how the code generation in RIA services SP1 works and I will demonstrate some scenarios and ideas were customizing the generated code is a nice technique to extend your own framework.

Functions in the Entity Framework 4.0: part 3

Over the last few weeks I’ve been writing a series of articles that cover some great improvements in the Entity Framework 4.0 In this third article I will explore some SqlClr features and show how to call custom .NET functions and aggregates in LINQ to Entities queries.

Functions in the Entity Framework 4.0: part 2

In this second article about the Entity Framework version 4.0 user defined functions and the new Model Defined Functions will be explored.

Based on a series of simple examples I will show how to map UDF’s and Entity SQL expressions to Model Defined Functions and how to call them in LINQ to Entities queries.

Functions in the Entity Framework 4.0: part 1

The Entity Framework together with LINQ to Entities are very powerful technologies to access and manipulate data from a database. At first glance everyone is impressed by the conceptual layer which is mapped to tables in a database. When building large scale enterprise applications you will notice that the EF has a few shortcomings. When you need to gain performance or need extra security, stored procedures and user defined functions are often required. In this first article in a series of three I will focus on how to use stored procedures in the Entity Framework 4.0. In the second article I will demonstrate how to map user defined functions to model defined functions and to call them in LINQ to Entities queries. And in the final article SqlClr functions will be explored.

Visual Studio 2010, .NET 4.0 & Silverlight 4.0 RC links

A few weeks ago Visual Studio 2010 & .NET 4.0 (CLR, BCL, WPF, WCF, EF, …) release candidates have been released. Last week during the MIX ’10 conference Silverlight 4 & WCF RIA Services v1 RC have been set online. Also a first community preview of Silverlight for Windows Phone 7 has been released. So it’s time to roundup all download locations and links to useful articles, blog posts, videos, samples, …

Visual Studio 2010

.NET 4.0

Entity Framework 4.0

WPF 4.0

WCF 4.0

WIF

Silverlight 4.0

Windows Phone Tools

What’s New in the Base Class Libraries in .NET Framework 4

Silverlight 4 design-time features for ViewModels

Visual Studio 2010, .NET 4.0 and Silverlight 4 offer a lot of new features. I like all the new features but I was especially interested in improvements that could help my current developments which are based on a M-V-VM architecture with ViewModels and a lot of bindings with UI controls. So I wrote an article and published it on my personal website. The article will focus on the improved design-time features. Along the way I will show a lot of screenshots and try to cover some other new Silverlight 4 features.

Silverlight 4 beta and WCF RIA Services CTP

Yesterday Microsoft released some new preview and beta versions of Silverlight, RIA Services, Blend, Media Framework, Toolkit, … It looks like a major update with a lot of new features (webcam support, RichText control, HTML content, access to local files, drag and drop, ICommand, right clicks and mouse wheel support, …) and improvements (data binding, validation, DataGrid, clipboard, styles, unit testing, …) In this post I will refer to the most interesting posts:

  • Tim Heuer gives a great overview with some videos of all new features in Silverlight 4 beta.
  • Fore more detailed information and examples about Silverlight 4 you should take a look at Mike Taulty’s posts.
  • Also Alex Golesh started posting a lot of detailed examples.
  • On Channel9 you can find several hands-on-labs from John Papa that demonstrate all new Silverlight 4 features.
  • Nick Kramer posted a Word document with an overview of the new security features in Silverlight 4.
  • Jeff Wilcox posted a large walkthrough to demonstrate how to use the Silverlight unit testing tools.
  • In the RIA Services forum you will find more information about the new preview of WCF RIA Services. Don’t forget to read the “Breaking changes” document.
  • And Brad Abrams describes the new features in WCF RIA Services CTP that are based on feedback of us developers and he also posted a nice step-by-step guide of his demo at PDC 2009.
  • Gill Cleeren succeeded in creating a blogpost about Silverlight 4 for each day of the month December.

Advanced databinding with ViewModels in Silverlight

Silverlight and RIA Services are great technologies and the Model-View-ViewModel (M-V-VM) pattern is a nice approach to keep UI and logic separated. But using the combination of view models with item controls, dataforms and commands can be a laborious task because the databinding features in Silverlight are quite limited. I posted an article on my website in which I demonstrate how binding with ViewModels can be improved by using the BindingHelper class and by creating your own command behaviors.

Silverlight 3 & RIA Services July CTP

Last week Microsoft released the official version of Silverlight 3, a new CTP (July 2009) of RIA Services and a RC of Expression Blend 3.0. SL3 is a major update and it is released 9 months after version 2.0, which is quite fast. SL3 provides out of the browser support, HD media support, better graphics, improved data binding, search engine optimization (SEO) support, … It seems that SL3 RTW disables the designer in Visual Studio 2008 because people were having a lot of problems with it. Fortunately the future version 2010 will provide a fully interactive WYSIWYG designer including data binding support within the designer.

Following links can be used to download all the needed setups. Make sure to uninstall the previous versions first.

It seems that these releases contain a lot of breaking changes. I’m already struggling 2 days to migrate a project that has been developed with Silverlight 3 beta and RIA Services CTP May. In SL3 the DataForm has been redesigned and there are changes in the AutoCompleteBox and DataGrid controls. In RIA Services a lot of things have been improved but also changed drastically; code sharing, loading data, authentication, custom validation, update parameters, …

Following blog posts and articles will help you to migrate:

Windows 7 for Developers

Last week I attended a two day Microsoft training about Windows 7 for Developers at U2U. We took a closer look at the Release Candidate and it’s features for developers.  It was quite interesting to see how to develop applications that use specific Windows 7 features like the new taskbar (thumb previews, jump lists, icon overlays), ribbons, multi touch, UAC, power management, sensors and location, Direct2D, DirectWrite, …

Afterwards I take some time to look up some extra information, libraries and tools. I found a lot of interesting websites and blog posts and so I summarize them here:

Windows 7

Microsoft already created a website with all information and downloads for Windows 7

Another very interesting source is Paul Thurott’s Supersite for Windows

As a developer you really should follow up the posts at the hereunder blogs. Sergey Zwezdin posted 10 great posts about programming Windows 7.

There are several Windows 7 forums with a lot of interesting posts. You surely should checkout the Tutorials section of SevenForums.

Windows API Code Pack

The Windows API Code Pack contains several .NET libraries to access all the new Windows 7 features. This MSDN Code Gallery page also provides several videos.

Federated Search (ODSX)

Following articles explain how to create your own Federated Search OSDX files. Popular OSDX files for Live, Google, MSDN, Wikipedia, Flickr, … can also be downloaded.

Boot from VHD files

Windows 7 offers great support for virtual harddisks and following articles describe how to create and mount these virtual harddisk VHD files and how to boot from them.

Library XML files

Windows 7 introduces the concept of libraries. A library is an aggregate of many different folders and it provides a view for specific content types. I noticed that there is no way to change a Library icon via the Windows UI. Following forum post explains where you can find the XML files which describe a Library and how to add a custom icon.

Run as different user

In Windows 7 the “Run as” option is not visible by default. It seems that it is implemented as an extended menu which is only displayed if you hold the SHIFT key. More info can be found at following forum post:

Ribbon

The WPF Ribbon control, a UI control that will replace menus, toolbars and popup windows in future applications, can be downloaded at Codeplex :

UAC

The User Account Control Helpers library is a project on CodePlex supporting all the UAC features of Windows Vista and Windows 7. It facilitates interaction with the UAC mechanism, handles manifest creation, extraction and embedding, and more.

Compatibility

Microsoft provides a Application Compatibility Toolkit (ACT) that contains all the necessary tools and documentation to evaluate and mitigate application compatibility issues before deploying applications to Windows 7. The toolkit already contains a lot of shims but you can also create your own shims to force privileged rights or program files or registry virtualization to run older applications.

Instrumentation

Following MSDN page provides a good overview of all the performance analysis, instrumentation, WMI, … features and tools:

If you are using WMI, you definitely should check out the LINQ to WMI project at CodePlex:

Training Kit

Update: The official Windows 7 Training Kit for Developers can be downloaded at the Microsoft website

Last week I attended a two day Microsoft training about Windows 7 for Developers at U2U. We took a closer look at the Release Candidate and it’s features for developers. It was quite interesting to see how to develop applications that use specific Windows 7 features like the new taskbar (thumb previews, jump lists, icon overlays), ribbons, multi touch, UAC, power management, sensors and location, Direct2D, DirectWrite, …

Afterwards I take some time to look up some extra information, libraries and tools. I found some interesting websites and blog posts and so I will share them:

Windows 7

Microsoft already offers a website with all info and downloads about Windows 7: http://www.microsoft.com/windows/windows-7/

Another very interesting source is Paul Thurott’s Supersite for Windows : http://www.winsupersite.com/faq/windows_7.asp

Several Windows 7 forums contain a lot of interesting posts:

http://www.sevenforums.com

http://www.w7forums.com/

http://windows7forums.com

Windows API Code Pack

The Windows API Code Pack contains several .NET libraries to access all the new Windows 7 features.

http://code.msdn.microsoft.com/WindowsAPICodePack

Federated Search (ODSX)

Following articles explain how to create your own Federated Search OSDX files. Popular OSDX files for Live, Google, MSDN, Wikipedia, Flickr, … can also be downloaded.

http://msdn.microsoft.com/en-us/library/dd742951(VS.85).aspx

http://www.windows7hacker.com/index.php/2009/04/how-to-create-custom-open-search-in-windows-7/

http://www.blogsdna.com/2307/windows-7-search-connectors-for-google-youtube-yahoo-wikipedia-twitter.htm

http://www.beingmanan.com/wp/2009/01/windows-7-resources-built-how-to-on-themes-connectors/

http://www.sevenforums.com/tutorials/742-windows-7-search-federation-providers.html

Boot from VHD files

Windows 7 offers great support for virtual harddisks and following articles describe how to create and mount these virtual harddisk VHD files and how to boot from them.

http://edge.technet.com/Media/Windows-7-Boot-from-VHD/

http://blogs.zdnet.com/hardware/?p=3324

Library XML files

Windows 7 introduces the concept of libraries. A library is an aggregate of many different folders and it provides a view for specific content types. I noticed that there is no way to change a Library icon via the Windows UI. Following forum post describes where you can find the XML files which describe a Library and how a custom icon can be added.

http://www.sevenforums.com/tutorials/3011-libraries-icons-change.html

Run as different user

In Windows 7 the “Run as” option is not visible by default. It seems that it is implemented as an extended menu which is only displayed if you hold the SHIFT key. More info can be found at following forum post:

http://www.sevenforums.com/tutorials/419-run-different-user.html

Ribbon

The WPF Ribbon control, a UI control that will replace menus, toolbars and popup windows in future applications, can be downloaded at Codeplex :

http://wpf.codeplex.com/Wiki/View.aspx?title=WPF%20Ribbon%20Preview

UAC

The User Account Control Helpers library is a project on CodePlex supporting all the UAC features of Windows Vista and Windows 7. It facilitates interaction with the UAC mechanism, handles manifest creation, extraction and embedding, and more.

http://uachelpers.codeplex.com/

Compatibility

Microsoft provides a Application Compatibility Toolkit (ACT) that contains all the necessary tools and documentation to evaluate and mitigate application compatibility issues before deploying applications to Windows 7. The toolkit already contains a lot of shims but you can also create your own shims to force privileged rights or program files or registry virtualization to run older applications.

http://www.microsoft.com/downloads/details.aspx?FamilyId=24DA89E9-B581-47B0-B45E-492DD6DA2971&displaylang=en

Instrumentation

Following MSDN page provides a good overview of all the performance analysis, instrumentation, WMI, … features and tools:

http://msdn.microsoft.com/en-us/performance/default.aspx

If you are using WMI, you definitely should check out the LINQ to WMI project at CodePlex:

http://www.codeplex.com/linq2wmi

First look at RIA Services

A few months ago Microsoft released the first preview of .NET RIA Services. This new framework promises to simplify building n-tier Line of Business (LoB) applications by providing patterns, components and tools to build services, query data, handle CRUD operations, resolve concurrency, manage data validation, … The March 2009 and the new May 2009 CTP’s only support Silverlight 3 but the final version will also offer support for ASP.NET/MVC/AJAX and WPF.

I have been exploring RIA services for a few weeks now and I must admit that I’m really excited. The architectural design looks quite good, these first CTP’s work fine and it really boosts productivity. The RIA Services framework handles all the plumbing to move entities from the server to the client, it offers advanced change-tracking and caching, several techniques for data validation are provided, there is support for authentication and roles, the integration with Silverlight UI controls like DataForm and DataPager works great and the current support for the ADO.NET Entity Framework really simplifies certain tasks.

If you want to start exploring RIA Services then you should definitely start reading the PDF document that Microsoft has published. This document gives a very good overview of all features of RIA Services.

While using RIA Services I found several great features that I wanted to blog about. In the coming months I will try to write a series of articles about RIA Services. I will not explain the details about its design, but I will try to give a lot of code samples, tips and ideas. I also stumbled upon some limitations and shortcomings of the current preview. So in this first article I will focus on the current limitations and I will offer you some of my workarounds and tips.