Skip to main content

Posts

Showing posts from 2010

TF266044: One or more machines are not ready to run workflows.

When configuring a new lab environment for a client, I encountered the following error: Environment message: Type=Error; Message=TF266044: One or more machines are not ready to run workflows. For more information, see the individual machine errors.; Machine messages: Machine name: XXXXXX Machine message: Type=Error; Message=Error occurred while configuring TFSBuildServiceHost with Lab configuration. ExceptionType:Microsoft.TeamFoundation.Build.Client.BuildServiceHostAlreadyExistsException. ExceptionMessage: A build service host already exists for computer XXXX.domain.net. Specify a different computer name and try again. I found the solution in the following blog post ( http://blogs.msdn.com/b/lab_management/archive/2010/02/09/additional-upgrade-script-for-fixing-build-agent-registration.aspx ). Although our TFSenvironment wasn’t upgraded from the Beta 2, the fix still works if you encounter this error message.

Export mapping files generated by Fluent NHibernate

If you are using  NHibernate , you probably also heard about Fluent NHibernate which allows you to create your object-relational mapping from a mix of conventions and code instead of using error-prone XML files. Although you’re using a completely different API under the hood the same old XML files still exist. Sometimes it would be handy to view the NHibernate mapping files generated by Fluent NHibernate.It turns out that this is quite easy and you will just need to add a call to the method ExportTo() and then the mappings will be created in the location specified. 1: private static ISessionFactory CreateSessionFactory() 2: { 3: string outputdir= Path.Combine(System.Environment.CurrentDirectory, "Mappings" ); 4: 5: return Fluently.Configure() 6: .Database(SQLiteConfiguration.Standard.InMemory().ShowSql()) 7: .Mappings(M => M.FluentMappings.AddFromAssemblyOf<SessionFactory>() 8: .ExportTo(outputdir)) 9

Distributing check-in policies across your team

One of the nicest features of Team Foundation Server are the check-in policies. They allow you to validate specific rules before each check-in. What makes this even nicer is that you can easily write your own check-in policies. However there is one problem, the check-in policy(read: DLL) needs to be installed on the developer machine. This is important because if developers do not install check-in policies they would not be run during a Check-in. Before you start inventing the most complex deployment strategies to get the latest version of these policies on the developer machines, note that there is already a feature available, included in the TFS power tools . After installing power tools , a new node is added in Team Explorer called Team Members . Right click in the Team Members node and choose Personal Settings . From there you can see all the options for the collaboration features and one interesting option called Install downloaded custom components . This extension veri

Impress your colleagues with your knowledge about… PDB files

Most developers know that PDB files help you in some way with debugging, but that's about it. They are a dark art for most developers only completely understand by a few evil magicians. Let me help you understand what PDB files are and how they can help you making your debugging experience a lot easier. First read the following 3 important rules and never forget them! Rule 1 – PDB files are as important as source code First and foremost PDB files are as important as source code! Debugging bugs on a production server without finding the matching PDB files for the deployed build can cost you tons of money. Without the matching PDB files you just made your debugging challenge nearly impossible. Rule 2 – As a development shop, I should have a Symbol Server At a minimum, every development shop must set up a Symbol Server. A Symbol Server stores the PDBs and binaries for all your public builds. That way no matter what build someone reports a crash or problem, you have the exact

WCF vNext: Linq to WCF

One of the great new features coming to WCF vNext is the ability to expose a service through an IQueryable interface. This introduces the rich query model of OData to your own WCF services. How does this work? Making the service queryable On the server side, your service operation should return an IQueryable<T>. Annotate the operation with the new [QueryComposition] attribute. Once you do that, your service becomes queryable using the OData uri format. 1: [WebGet(UriTemplate = "" )] 2: [QueryComposition] 3: public IQueryable<Customer> Get() 4: { 5: return customers.AsQueryable(); 6: } The Get method above returns an IQueryable of customers. With the query composition enabled, the host will now accept requests like “http://localhost/customers?$filter=Countrye%20eq%20Belgium” which says “find me all the customers from Belgium”. Querying the service, LINQ to WCF On the client side Microsoft added a CreateQuery<T> extension

Boost the performance of your ASP.NET and WCF applications

By default both IIS and WCF are somewhat restrictive in their default settings. Executing a large number of concurrent call’s will not have much effect as by default only 2 concurrent connections per IP are allowed. However there are some simple configuration changes that you can make on machine.config and IIS to give your web applications significant performance boost. These are simple harmless changes but makes a lot of difference in terms of scalability. To learn how to do this, read this article “Quick ways to boost performance and scalability of ASP.NET, WCF and Desktop Clients” written by Omar Al Zabir .

ThreadStatic and ThreadLocal<T>

For a long time I was using the Thread­Sta­tic attribute to make the value of a sta­tic or instance field local to a thread (i.e. each thread holds an inde­pen­dent copy of the field). Although this did the trick for a long time, the ThreadStatic attribute had some disadvantages: the Thread­Sta­tic attribute doesn’t work with instance fields, it com­piles and runs but does nothing.. fields always start with the default value With the release of C#  4 Microsoft intro­duced a new class specif­i­cally for the thread-local stor­age of data – the ThreadLocal<T> class: 1:   2: ThreadLocal< int > _localField = new ThreadLocal< int >(() => 1); 3:   So why should you choose the ThreadLocal<T> class? Thanks to the use of a factory function, the val­ues are lazily eval­u­ated, the fac­tory func­tion only executes on the first call for each thread you have more con­trol over the ini­tial­iza­tion of the field and you are able to ini­tial­ize the field

How to be a bad programmer?

People always learn the most from their mistakes. So when talking about what defines a good programmer versus what defines a bad programmer, it’s sometimes interesting and easier to discuss what makes someone a bad programmer instead of a good one. Giorgio Sironi wrote a great article about “How to be a worse programmer?” A must read!

Silverlight 5: Microsoft’s answer on the Silverlight is dead discussion

The last few weeks, there was a lot of buzz around the future of Silverlight. Although there were some official comments , the rumors kept going. For the remaining skeptics,  what can be a better answer than the announcement of Silverlight 5. A t the Silverlight FireStarter event Microsoft announced the timeline for Silverlight 5 in 2011.  Silverlight 5 was the main subject of  Scott Guthrie’s keynote where Microsoft demoed many of the coming new features and capabilities.  Silverlight 5 will be in beta the first half of 2011 and ship early in the second half of 2011. Some of the impressive improvements(note especially XAML debugging): Silverlight 5 Media improvements: Hardware Decode & Presentation of H.264 performance improvements using GPU support Trickplay with fast-forward and rewind support w/normal audio pitch Improved power awareness Remote-control support Digital Rights Management advancements Application Development improvements: Smoot

Hostname mynamespace.servicebus.appfabriclabs.com can't support more than 1 level subdomain.

Last week I wanted to test some new Windows Azure Servicebus functionality. So I started by creating a simple WCF service to host on the cloud. After configuring my service settings in the web.config, I started the service and was confronted with the following error message: Hostname mynamespace.servicebus.appfabriclabs.com can't support more than 1 level subdomain. It took me some time to figure out the root cause of the problem. I had created a namespace on http://portal.appfabriclabs.com . After checking with Fiddler what was going on I realized that although I was using the appfabriclabs environment, the authentication was still passing on to windows.net with the error message above as a consequence. After creating a service namespace through  https://appfabric.azure.com . the application ran successfully.

Using XML namespaces in WPF

When referencing controls from another assembly in XAML, you probably use the xmlns:myAlias="clr-namespace:MyNamespace;assembly=MyAssembly" syntax. Last week I discovered you also have another option, you can use an Uri instead of a namespace reference thanks to the XmlnsDefinition attribute. (Read more about this attribute on MSDN ). It allows you to map a XAML namespace to one ore more assembly namespaces. So how do you use it? Open the AssemblyInfo.cs file under the Properties folder of your project. Add the following line for each namespace in your assembly you want to map: 1: [assembly: AssemblyTitle( "WPF Namespace Sample" )] 2: [assembly: AssemblyDescription( "" )] 3: [assembly: AssemblyConfiguration( "" )] 4: [assembly: AssemblyCompany( "" )] 5: [assembly: AssemblyProduct( "WPF Namespace Sample" )] 6: [assembly: AssemblyCopyright( "Copyright © 2010" )] 7: [assembly: AssemblyTra

Build times for TFS Team Build

After creating an application to monitor builds over multiple Team Projects ,  the customer came back with a second request. As they had the feeling that some builds took a long time to complete they asked us to update the application to include build timings. A colleague took my application and extended it with some extra code. Full code below: 1: class Program 2: { 3: static void Main( string [] args) 4: { 5: // The url to the tfs server 6: Uri tfsUri = new Uri( "<TFS URL>" ); 7: TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tfsUri); 8: IBuildServer bs = tfs.GetService<IBuildServer>(); 9: WriteQueuedBuilds(bs); 10: Console.ReadLine(); 11: } 12:   13: private static void WriteQueuedBuilds(IBuildServer bs) 14: { 15: IQueuedBuildSpec qbSpec; 16: IQueuedBuildQueryResult qbResults; 17: qbSpec

Windows Azure Platform 30 Day Pass

Microsoft launched a new offer to get started with Windows Azure: the   Windows Azure platform 30 day pass. Great news is that no credit card  is required . The only thing you need to do is click on the following link and use the Promo Code to get going: Use this Promo Code : DPWE01 Sign Up By Clicking This Link : http://www.windowsazurepass.com/?campid=BB8443D6-11FC-DF11-8C5D-001F29C8E9A8 The Windows Azure platform 30 day pass includes the following resources: Windows Azure 4 small compute instances 3GB of storage 250,000 storage transactions SQL Azure Two 1GB Web Edition database AppFabric 100,000 Access Control transactions 2 Service Bus connections Data Transfers (per region) 3 GB in 3 GB out Have a cloudy day!

Visual Studio 2010 SP1 Beta released

Last week Microsoft released a BETA   version of Visual Studio 2010 Service Pack 1. Although a lot of blog posts mentioned the fact that the beta was released, I didn’t find a lot of information about the exact content and features that will be released in Service pack 1. So here is an aggregation of some blog posts which together give you a full overview of all the goodness that’s coming: General overview: http://blogs.msdn.com/b/bharry/archive/2010/12/07/vs-tfs-2010-sp1-beta-has-released.aspx Testing features: http://blogs.msdn.com/b/amit_chatterjee/archive/2010/12/10/visual-studio-2010-service-pack-1-beta-released-information-on-test-and-lab-management-changes.aspx HTML 5 support, IIS Express, SQL Compact 4, IntelliTrace for 64bit,…: http://www.hanselman.com/blog/VisualStudioExplosionVS2010SP1BETAReleasedAndContext.aspx

Great Windows Phone 7 productivity story

As a .NET developer by day, choosing for a Windows Phone seems more obvious than choosing an IPhone or Android phone. However if you don’t use Microsoft products every day, the choice is a lot harder. So if you are a developer planning to create applications on one of the mobile platforms, certainly read this great story comparing development productivity between iOS, Android, WP7 and mobile Web: http://dotneteers.net/blogs/vbandi/archive/2010/12/06/just-how-productive-is-wp7-development-compared-to-ios-android-and-mobile-web.aspx Definitely a great proof of the power of the Windows Phone 7 development experience!

New Visual Studio 2010/ TFS 2010 VPC’s available

Most of the time if I have to do a demo about Team Foundation Server I use our own TFS (Test) environment. However some clients want to see some specific functionality or don’t have Internet access available for me. In that case I fall back to the standard TFS 2010 demo VPC’s that Microsoft provides us. Last week Microsoft released a new version of these VPC’s. This new version contains the latest feature packs, power tools, and Windows Updates. This refreshed VM will stop working on June 1, 2011 . What’s new in this version? Visual Studio 2010 Feature Pack 2 Team Foundation Server 2010 Power Tools (September 2010 Release) Visual Studio 2010 Productivity Power Tools · Test Scribe for Microsoft Test Manager Visual Studio Scrum 1.0 Process Template All Windows Updates through December 8, 2010 Lab Management GDR (KB983578) Visual Studio 2010 Feature Pack 2 pre-requisite hotfix (KB2403277) Microsoft Test Manager hotfix (KB2387011) Minor fit-and-fini

Prevent hanging build from blocking your TFS build server

Last week I had a question from a customer who complained that all builds on their build server blocked because of one build that sometimes fails. Now the reason why this build failed is something for another blog post. In this post I’ll focus on the way how to prevent that a hanging build keeps blocking your build server. If you open up your build definition, go to the Process tab and expand the Advanced node, you’ll find the Agent Settings node. If you further expand this node you see that you can  specify the following parameters: Maximum Execution Time Type a time span value in hh:mm:ss format. For example, the build will fail with a time-out error if you specify a value of 04:30:15 and the build agent has not completed its work after 4 hours, 30 minutes, and 15 seconds. Specify a value of 00:00:00 if you want to give the build agent unlimited time to process the build. (By default this value is 00:00:00 and this i

Saving NHibernate objects with assigned id’s

One of the great features of Nhibernate is that it manages persistance for us. You just attach an object to the session and NHibernate will figure out if this object is added or changed. But how does NHibernate knows the difference between a new and existing object? By default it uses the value we assigned to the unsaved-value attribute on the id mapping. This means that if the id of our object is equal to our unsaved-value that NHibernate will detect this object as new and do an INSERT statement. If the id value is different from our unsaved-value NHibernate will generate an UPDATE statement instead.   1: < hibernate-mapping default-cascade ="none" xmlns ="urn:nhibernate-mapping-2.2" > 2: < class name ="Test.Data.Domain.Category, Test.Data" table ="Categories" lazy ="true" > 3: < id name ="CategoryID" type ="System.Int32" column ="CategoryID" unsaved-value ="

Impress your colleagues with your knowledge about…the volatile keyword

Sometimes when working with C# you discover some hidden gems. Some of them very useful, other ones a little bit harder to find a good way to benefit from their functionality. One of those hidden gems that I discovered some time ago is the volatile keyword. The volatile keyword indicates that a field might be modified by multiple threads that are executing at the same time. Fields that are declared volatile are not subject to compiler optimizations that assume access by a single thread. This ensures that the most up-to-date value is present in the field at all times. The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock statement to serialize access. The following example demonstrates how an auxiliary or worker thread can be created and used to perform processing in parallel with that of the primary thread.   1: using System; 2: using System.Threading; 3:   4: public class Worker 5: { 6: // This me

Software can not be manufactured

As developers we all agree with the title of this post. Still, a lot of desperate managers and business owners keep pretending that software development is a manufacturing process at heart. Requirements specifications are created by analysts, architects turn these specifications into a high-level technical vision. Designers fill out the architecture with detailed design documentation, which is handed to robot-like coders, who sleepily type in the design’s implementation. Finally, the quality inspector  receives the completed code, which doesn’t receive her stamp of approval unless it meets the original specifications. This sounds an awful lot like the typical waterfall methodology if you ask me! It is no wonder that managers want software development to be like manufacturing. Managers understand how to make manufacturing work, we all do. We have decades of experience in how to build physical objects efficiently and accurately. So, applying what we’ve learned from manufacturing,

Deleting Team Foundation Server Team Projects

If you want to remove a team project from Team Foundation Server when the project is no longer required, you can use the TFSDeleteProject command line tool. This tool can also be used if there are components that remain undeleted after an unsuccessful team project creation. TFSDeleteproject [/q] [/force] [/excludewss] /collection:URL TeamProjectName You can find the TFSDeleteProject command-line tool in Drive:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE on any client computer that runs Team Explorer. Remark: TFSDeleteProject permanently destroys the team project, after which it cannot be recovered. You should backup all important project data before using TFSDeleteProject .

31 days of Windows Phone

Interested in the Windows Phone 7? But you don’t know where to start? First download the free Windows Phone 7 developer tools . The following is installed with the download: Visual Studio 2010 Express for Windows Phone – Free edition of VS 2010 for Phone development. Express Blend 4 for Windows Phone – Free version of Blend for Windows Phone 7 Development. Silverlight for Windows Phone 7 – Rich framework for building great applications for Windows Phone 7. XNA Game Studio for Windows Phone 7 – Rich framework that enables you to build great 2D and 3D games for Windows Phone 7. Windows Phone Emulator – A hardware accelerated emulator that allows you to run and debug your applications and games without requiring a phone. Phone Registration Tool – When you get a device, this allows you to “unlock” the device so you can run/debug your application on it, using your Marketplace account . Afterwards read the 31 Days of Windows Phone 7 blog series by Jeff Blan

NHibernate 3.0 GA released

The GA(General Availability=Final) version of NHibernate 3.0 got released yesterday. Go get it! Most important improvements are the ability to use lambda expressions and a full-blown LINQ provider. Plans for version 3.1 include additional bug fixes and patches, as well as enhancements for the new LINQ provider.

Free e-books for .NET programmers

“There is not such a thing as a free lunch.” Most of the time this is true, but sometimes you find a lot of information for free! I noticed this blog post by Anoop Madhusdanan where he mentions 7 freely available e-books for .NET programmers and architects. If you need a (cheap) gift under the Christmas tree, you’ve find it :-)

Visual Studio 2010 Extensions: Colored Console Application Template

With the release of Visual Studio 2010, creating and finding extensions became a lot easier thanks to the build in Extension Manager. One of the great extensions I discovered is the Colored Console Application Template . Creating a Console application in Visual Studio was always easy. But the standard Console Application project is rather … empty. The moment you needed a mature console application, you probably started adding features like: Functional style command line parser Console Coloring Help With the Colored Console Application Template you no longer have to add these features yourself. You’ll get them out of the box for free including a lot of other features. You can download the template directly from Visual Studio through the Extension Manager or go here and install it yourself.

Error adding test case, there is no test with specified id.

Last week I was testing the Coded UI Test feature of Visual Studio 2010. But when I ran the test in an lab management virtual environment, the test returned an error. In the error log I found the following error message: Error adding test case [xx] to test run: There is no test with specified Id {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. I found out that the error was caused by the fact that I was running the test against a build that didn’t contain the coded UI Test associated with the Test case.  The problem was that I scheduled a new test run in the Microsoft Test manager without changing the build. To solve the error I queued a build, verified that the build succeeded, then changed the build associated with the test plan. So be sure that your test plan is always up to date with the correct build.

Visual Studio 2010 Feature Pack 2

Visual Studio 2010 Feature Pack 2 is now available to MSDN subscribers. This introduces some new testing features inside Visual Studio 2010: Use Microsoft Test Manager to capture and playback action recordings for Silverlight 4 applications. Create coded UI tests for Silverlight 4 applications with Visual Studio 2010 Premium or Visual Studio 2010 Ultimate.. Edit coded UI tests using a graphical editor with Visual Studio 2010 Premium or Visual Studio 2010 Ultimate. Use action recordings to fast forward through manual tests that need to support Mozilla Firefox 3.5 and 3.6. Run coded UI tests for web applications using Mozilla Firefox 3.5 and 3.6 with Microsoft Visual Studio 2010 Premium or Visual Studio 2010 Ultimate. For more details, see http://go.microsoft.com/fwlink/?LinkID=192777 Microsoft also created some videos on the new Testing features in Visual Studio 2010 Feature Pack 2: Coded UI Test for a Silverlight Application Features of Coded UI Test

Check-in Policy override feature

In Team Foundation Server, you have the concept of check-in policies. This feature allows you to define a set of checks that have to succeed before a developer can check-in it’s code. But a developer can always override these check-in policies and still do a check-in. A lot of customers ask if they can block the user from overriding the policy. To state it clear: you cannot disable this feature. However you can get alerts when someone overrides the policies: Click Team --> Alerts Explorer. Add a CheckinEvent. Set Alert Definition to PolicyOverrideComment<>''

Debugging SQL with SQL Management Studio

I think we all agree that testing stored procedures and functions on a database tier can be time consuming, they are hard to debug and sometimes just difficult to get clarity on what is “happening”.  To help you understand what’s going on, you can use the built-in debugging features of Microsoft SQL Management Studio. These allow you to see exactly what is going on, and step through your logic in a similar fashion as in Visual Studio. To get you going check this post( Debugging SQL Queries, Functions, & Stored Procedures with SQL Management Studio’s Integrated Debugger ) by Doug Rathbone.

Windows Azure SDK updated

Today the Azure team released SDK 1.3 and the updated tools for Visual Studio. Download the SDK here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7a1089b6-4050-4307-86c4-9dadaa5ed018 New for version 1.3: Virtual Machine (VM) Role (Beta): Allows you to create a custom VHD image using Windows Server 2008 R2 and host it in the cloud. Remote Desktop Access: Enables connecting to individual service instances using a Remote Desktop client. Full IIS Support in a Web role: Enables hosting Windows Azure web roles in a IIS hosting environment. Elevated Privileges: Enables performing tasks with elevated privileges within a service instance. Virtual Network (CTP): Enables support for Windows Azure Connect, which provides IP-level connectivity between on-premises and Windows Azure resources. Diagnostics: Enhancements to Windows Azure Diagnostics enable collection of diagnostics data in more error conditions. Networking Enhancements: Enables rol

Lab management deployment script arguments

Lab management 2010 allows you to automate the build-deploy-test workflow. By following a simple wizard, you can easily create a build of your code, run some deployment scripts to deploy the build on a test environment and run some tests inside this environment and all this by just triggering a new build inside Visual Studio. The deployment scripts being run as part of the workflow can be anything from a batch file to an MSI or a power shell script. There are a few built-in arguments available that can be passed to these scripts:   Argument Description $(BuildLocation) Refers to the location from where the binaries will be picked up for deployment. It depends on the option that is chosen in the "Build" page in the "Lab Workflow parameters" wizard. If "TeamBuild" option is chosen, then the drop location of the concerned build will be referred to. If a build location is specified explicitly, then that loc

Change the placement policy of your System Center Virtual Machine Manager configuration

Last week a colleague was creating a new test environment using the Team Foundation Server Lab Management features when we encountered following error: Error when creating a new virtual machine on <machinename>: TF259115: Team Foundation Server could not find any suitable host to deploy the virtual machine: <machinename>. Contact your administrator to fix the issues on the hosts below. (Hosts are listed in brackets) Memory requirement of the virtual machine(s) exceeds the available host resources. The placement policy for this host group is set to be conservative and hence virtual machines that are in stopped state are also accounted as consuming host resources. Your administrator can change this policy by running the TfsLabConfig tool. As our lab management environment has a large set of virtual machines who are in a stopped state, we ran out fast of memory resources. We can change this behavior to exclude the non-running machines from memory usage. T

Slow connection when connecting to Team Foundation Server from Visual Studio 2010

At a client we were testing our newest line of development machines. After installing Visual Studio 2010 we noticed that the performance was VERY slow when connecting to Team Foundation Server (2010). Performing a get latest of a large solution took several hours(!). Some investigation showed that it does not appear to be a TFS issue per se but rather something lower in the .NET Framework stack, having to do with automatic proxy discovery through the WPAD protocol. You can work around the issue by turning off proxy autodiscovery on a per-application basis by using a .exe.config setting. The .exe.config for Visual Studio is %VSINSTALLDIR%\Common7\IDE\devenv.exe.config and it already contains a section in the .exe.config for System.Net. After adding the defaultProxy element, that section would look like this: 1: < system.net > 2: < defaultProxy enabled ="false" /> 3: < settings > 4: < ipv6 enabled ="true" /> 5:

WPF and Winforms “airspace problem”: a solution

In a previous post , I talked about the “airspace problem”, an issue you can encounter when you are using WPF and WinForms in the same application. I created a small sample application that shows the issue and I’ve also added a possible solution. If you run the application, you’ll see the following user interface: This userinterface contains the following important elements: A WPF Grid control that is not visible by default A WPF button A WindowsFormsHost control containing a usercontrol with a calendar control inside When you click the button, the WPF Grid will be made visible. You see that the winformshost control is still shown on top of the grid(recognizable by the brown border on the left and the bottom. Now try again but first select the Solve Airspace problem checkbox. This time the control is correctly shown on top of the winformshost. Download the code and the sample application here .

Learn Python the hard way

They always say that to be a good programmer, you have to learn a new programming language every year.  I am still finding my way in the Ruby world, but for people who are looking for the next challenge, I can recommend “Learn Python The Hard way” , a free e-book for people who want to learn Python . It is really, really(!) basic but I found it useful to get the syntax in my fingers without having to think too much about more complex programming problems.

Build fails after upgrading to Visual Studio 2010

After upgrading our solution and projects to Visual Studio 2010, our builds started to fail with the following error: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (1917,9): errorMSB3086: Task could not find "LC.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed For a reason I don’t know it expects the 7.0A SDK. And indeed on the build server this SDK was not installed. With that knowledge I copied the directory "Program Files\Microsoft SDKs\Windows\v7.0A" from my development machine to my build server. I then exported the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A" registry key from my development machine and merged into the regist

Sharepoint Schema version error

At a client, the Team Foundation server 2010 environment was working fine until suddenly the Sharepoint stopped working. In the event log, I found the following error message: The schema version (3.1.8.0) of the database SharePoint_AdminContent_d3718c5d-5516-41e1-ba7d-6e5a3c21ba75 on DatabaseServerX is not consistent with the expected database schema version (3.1.11.0) on ApplicationServerY. Connections to this database from this server have been blocked to avoid data loss. Upgrade the web front end or the content database to ensure that these versions match. I found out that Windows Update had installed some patches which upgraded the Sharepoint application front end to a higher version. Unfortunately this made the front-end and the underlying database incompatible. I fixed the problem by executing the following commands on the application server: 1: stsadm -o upgrade -inplace -url < central admin url > 2:   3: iisreset

Team Foundation Server 2010 Extensibility

A lot of customers ask me which parts of Team Foundation Server and the Team Explorer Client are extensible. And my answer is always the same: everything! To give you some ideas and examples, go to the  TFS SDK page and download some of the available samples . One of the coolest examples is the “Extending Team Projects sample” , it extends Team Projects and Team Explorer in TFS 2010 and includes a Project Creation Wizard plug-in and a Team Explorer plug-in. Project Creation Wizard This sample uses a custom process template that declares a special group ID that includes a task list from a separate XML file. That XML file includes a set of web links arranged in a folder structure. Those links are passed to the Project Creation Wizard plug-in as the new Team Project is getting created. The plug-in also adds a new page to the wizard that lets the user enter additional web links and, optionally, to add a link to the newly created Team Project in Web Access. This page derives from

Windows Workflow Foundation 4: State Machines

With the release of .NET Framework 4, Microsoft completely rewrote the Windows Workflow Foundation(WF) implementation. One of the consequences was that the original workflow types(state machine and sequential) were replaced by a new sequential and flowchart implementation leaving state machines out of the picture. With the Microsoft WF State Machine Activity Pack CTP 1 Microsoft reintroduces a state machine implementation based on Windows Workflow Foundation in .NET Framework 4 (WF 4). The implementation contains not only a state machine runtime but also a graphical state machine designer. It’s a really great and robust CTP for everyone who needs state machine workflows. Thank you, Microsoft.

Windows Azure Connect

A few weeks ago, I blogged about Project Sydney . In the meantime Microsoft has released a first CTP under it’s official name: Windows Azure Connect . “Windows Azure Connect provides a simple and easy-to-manage mechanism to setup IP-based network connectivity between on-premises and Windows Azure resources. This capability makes it easier for an organization to migrate their existing applications to the cloud by enabling direct IP-based network connectivity with their existing on-premises infrastructure. For example, a company can deploy a Windows Azure application that connects to an on-premises SQL Server database, or domain-join Windows Azure services to their Active Directory deployment. In addition, Windows Azure Connect makes it simple for developers to setup direct connectivity to their cloud-hosted virtual machines, enabling remote administration and troubleshooting using the same tools that they use for on-premises applications.” You can register for the CTP here . If you

View builds across multiple projects

One very annoying thing in Team Foundation Server 2010 is that you can only see the builds for 1 team project in Team Explorer. This is especially a problem when you are running many builds and you want to know which builds are already queued/running. Luckily this is really easy to create yourself using the TFS object model.  Create a simple console application in Visual Studio and add the following code:   1: using Microsoft.TeamFoundation.Client; 2: using Microsoft.TeamFoundation.Build.Client; 3:   4: var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection( new Uri( "http://myTFS/MyCollection" )); 5: var bs = tfs.GetService<IBuildServer>(); 6: var qbSpec = bs.CreateBuildQueueSpec( "*" , "*" ); 7: var qbResults = bs.QueryQueuedBuilds(qbSpec); 8:   9: foreach (var qb in qbResults.QueuedBuilds) 10: { 11: var status = qb.Status.ToString(); 12: var def = qb.TeamProject + @"\"

Logging Visual Studio Actions

As almost every piece of software Visual Studio behaves strangely from time to time, weird error messages, crashes,… I’ve seen it all. A first help to trace the source of the problem is to start Visual Studio with logging enabled. You can do this by starting Visual Studio with the /log switch: devenv.exe /log [filename] The [filename] is optional and if not specified will call the log ActivityLog.xml by default.  The path is to the file is: %APPDATA%\Microsoft\VisualStudio\<version>\ActivityLog.xml  There is an XML stylesheet (XSL) comes with the XML data so if you view the file in your browser you will see this nice view:

From developer to designer: Kuler

Most developers are really great at writing code but if you ask them to create a user interface, they always come up with the same boring standard WinForms/WPF user interface. We all seem to suffer from a lack of aesthetic skills. To help you improve the look and feel of your windows/web application, I have one really nice tool to add to your toolbox: Kuler .  “Kuler is a web application for generating color themes that can inspire any project. No matter what you're creating, with Kuler you can experiment quickly with color variations and browse thousands of themes from the Kuler community” One of the features I really like is the ability to create a style theme from an image. If there is a specific painting, photo, … you like, it can be used a starting point for your own color theme. Try it yourself…

HTTP 403 when opening Sharepoint page

When I tried to open the Sharepoint portal for a Team Foundation server 2010 Team project, I received the following 403 error:   I had all the necessary rights and was connected to our domain, so I didn’t understand why this message was shown. It took me some time to find out that someone had changed the IIS server settings and changed the use of HTTPS and SSL to Required . Therefore I got an error when I connected to the website over HTTP. A more meaningful error message would have saved me a lot of time…

Could not open a Silverlight project

When I tried to open a Silverlight project inside Visual Studio 2010, it failed with the following error message: “The imported project "C:\Program Files\MSBuild\Microsoft\Expression\Blend\3.0\Silverlight\Microsoft.Expression.Blend.Silverlight.targets" was not found.” When I tried to open the project on another machine it worked fine. So I realized that it had to be an installation issue. After comparing the two systems I noticed that the Blend 4.0 SDK wasn’t installed on one machine. After installing the SDK everything worked perfect.

Enterprise Library 5 Fluent Configuration

One of the big disadvantages of Enterprise Library was that the configuration was very XML centric. In Enterprise Library 5 a new fluent configuration API has been added which allows you to configure your Enterprise Library settings without writing ton’s of XML. The API makes configuring Enterprise Library very intuitive and easy to learn. In order to use the fluent configuration API , you need to create a ConfigurationSourceBuilder which is the main class to build a runtime configuration. Each feature in Enterprise Library , such as the application blocks for example, provides extension methods for this class which enables us to use the API in the same manner. Thanks to the use of extension methods this is very intuitive and easy. The ConfigurationSourceBuilder class is located in the Microsoft.Practices.EnterpriseLibrary.Common.Configuration DLL and you need to reference it. In order to use the fluent configuration extension methods for every application block , you need to add

The [TestCategory] attribute

One of the lesser-known features added to .NET 4.0 is the TestCategory attribute . Comparable to the Category attribute in NUnit –this allows you to group your tests in functional categories. Using test categories is now the preferred way of running groups of tests, and you no longer need to deal with tests lists (.vsmdi files), which are tedious to maintain and very difficult to merge. You can use these test categories to optimize the build experience when using Team Build 2010. In the Build Definition there is a new option that allows you to include, exclude, combine,… multiple test categories in a build. Read more about it on MSDN .

Daddy, when I grow up I want to be a small basic developer

15 years ago I wrote my first program in Turbo Pascal . Nowadays if you have children and want them to learn programming check out Microsoft Small Basic , which combines a simple (but powerful!) language and a rich set of libraries together with a friendly development environment. The Small Basic language draws its inspiration for an early version of BASIC but it is actually based on the .NET Framework. Like the early variants of BASIC it is based on, Small Basic is imperative and doesn't use or expose beginners to concepts like scopes, types, object orientation, etc. Even though it is based on the .NET Framework, it really is small and consists of just 14 keywords. In fact, there really isn’t a type system. You can create string and numeric constants and assign them to variables. Operations performed on these variables will be interpreted according to the content. All variables are global and are always initialized, so they can be used before they're assigned. It’s ve