Wednesday, September 29, 2010

Failed to create a new Team Project using the Scrum for Team System template

On our test TFS server, creating a new project using the great Scrum for Team System template failed. In the log file I found following information:

Creating reports on the SQL Server Reporting Services on http://tfstest/ReportServer/ReportService2005.asmx.

The reason for the failure cannot be determined at this time. Because the operation failed, the wizard was not able to finish creating the SQL Server Reporting Services site.

Stack Trace:

at Microsoft.VisualStudio.TeamFoundation.RosettaReportUploader.Execute(ProjectCreationContext context, XmlNode taskXml)  
at Microsoft.VisualStudio.TeamFoundation.ProjectCreationEngine.TaskExecutor.PerformTask(IProjectComponentCreator componentCreator, ProjectCreationContext context, XmlNode taskXml)
at Microsoft.VisualStudio.TeamFoundation.ProjectCreationEngine.RunTask(Object taskObj)

--   Inner Exception   --

Exception Message: TF30225: Error uploading report 'Product Burndown Chart By Day': System.Web.Services.Protocols.SoapException: Error while loading code module: ‘Conchango.TeamSystem.Metrics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=13d7c658a290ad85’. Details: Could not load file or assembly 'Conchango.TeamSystem.Metrics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=13d7c658a290ad85' or one of its dependencies. The system cannot find the file specified.

at Microsoft.ReportingServices.WebServer.ReportingService2005Impl.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings)
at Microsoft.ReportingServices.WebServer.ReportingService2005.CreateReport(String Report, String Parent, Boolean Overwrite, Byte[] Definition, Property[] Properties, Warning[]& Warnings) (type ReportingUploaderException)

Exception Stack Trace:   

at Microsoft.TeamFoundation.Client.Reporting.ReportingUploader.UploadReport(XmlNode report)
at Microsoft.TeamFoundation.Client.Reporting.ReportingUploader.HandleCreateReports(XmlNode node)
at Microsoft.TeamFoundation.Client.Reporting.ReportingUploader.Run()
at Microsoft.VisualStudio.TeamFoundation.RosettaReportUploader.Execute(ProjectCreationContext context, XmlNode taskXml)

The problem is that the Metrics assembly isn’t installed on the application server. Normally this should be done automatically if the installer discovers a reporting services instance on the target machine.

A solution is to install and register this file yourself.

Get the file:

  1. Create an output directoy.
  2. Launch the installer and keep it open.
  3. Find the "ScrumForTeamSystem.msi" file that is written to the default temp location.
  4. Use the MSIEXEC command line utlity to extract the contents of the MSI.
    MSIEXEC /a "ScrumforTeamSystem.msi" /qb TARGETDIR={OUTPUTDIR}
  5. Find the "Conchango.TeamSystem.Metrics.dll" assembly.
    Located at: {OUTPUTDIR}\ProcessTemplate\Conchango.TeamSystem.Metrics.dll

Register the file:

  1. Open a Visual Studio Command prompt
  2. Run GacUtil /i {OUTPUTDIR}\ProcessTemplate\Conchango.TeamSystem.Metrics.dll to register the assembly in the Global Assembly Cache. 

Tuesday, September 28, 2010

Windows Azure Application Scenario’s

J.D. Meier did a post about some common application patterns for Windows Azure. Although I would not describe them as patterns myself (therefore they are too high level to really use them as a design starting point), they can be useful in presentations and high level discussions about the topic.

The covered scenario’s(patterns) are:

  • Pattern #1 - ASP.NET Forms Auth to Azure Tables
  • Pattern #2 - ASP.NET Forms Auth to SQL Azure
  • Pattern #3 - ASP.NET to AD with Claims
  • Pattern #4 - ASP.NET to AD with Claims (Federation)
  • Pattern #5 - ASP.NET to WCF on Azure
  • Pattern #6 - ASP.NET On-Site to WCF on Azure
  • Pattern #7 - ASP.NET On-Site to WCF on Azure with Claims
  • Pattern #8 - REST with AppFabric Access Control
  • Pattern #9 - ASP.NET to Azure Storage
  • Pattern #10 - ASP.NET to SQL Azure
  • Pattern #11 - ASP.NET On-Site to SQL Azure Through WCF
  • Monday, September 27, 2010

    Windows Server AppFabric Architecture guide

    Note: Don’t confuse this with Windows Azure AppFabric.

    Microsoft released the Windows Server AppFabric Architecture Guide.

    Windows Server AppFabric is a set of integrated technologies that make it easier to build, scale and manage Web and composite applications that run on IIS.

    The guide contains 2 parts:

    • Windows Server AppFabric Key Architectural Components: This section provides background about service hosting, the AppFabric Windows services (Event Collection service and Workflow Management service), the data storage tier, and the AppFabric security model.
    • Enterprise-Scale AppFabric Architecture and Deployment Topologies: This section provides architectural guidance on optimizing, deploying, and configuring both the AppFabric service and the data tiers.

    Sunday, September 26, 2010

    This is the kind of architect I want to be...

    With the growing interest in agile development approaches, the role of the (application) architect changes. Most agile methodologies even don’t define an “architect” role – so as an architect, what are you meant to do to help your team be successful?

    Tom Hollander, a solution architect at Microsoft Australia, held a presentation about the role of an architect in an agile team at TechEd Australia.


    Get Microsoft Silverlight

    A must see!

    Error getting latest version

    On a project that we recently migrated from Visual Source Safe to TFS 2010, getting the latest version of the code failed.

    If we did the the source control action in the from the source control explorer window, there was no problem. But the moment we opened the solution, right click on it and choose ‘Get latest version’, an error message pops up:

    SCCError

    Cleary the cvapipath.cpp is indicating that this is a Visual SourceSafe related error, which is strange because we are using Team Foundation Server. Removing and recreating the suo file solved the issue.

    Saturday, September 25, 2010

    Layered architecture sample for Azure

    When browsing through Codeplex, I found the following interesting sample: Layered Architecture Sample for Azure. It is a layered application in .NET ported to the Windows Azure platform to demonstrate how a carefully designed layered application can be easily deployed to the cloud. It also illustrates how layering concepts can be applied in the cloud environment.

    Cloud-sample.jpg

    Clean Code Cheat Sheet

    Writing code is hard, writing clean code is even harder. I found 2 cheat sheets about clean code.

    The first covers clean code – code that is easy readable and keeps changeable. The second is about Test Driven Development. Both cheat sheets list principles, patterns, practices and smells.

    Download them here : Clean Code, Clean TDD.

    Where to put your Javascript code?

    Let me first answer the question,

    “JavaScript code is  supposed to go at the bottom of your page!”

    The first time I read this, this seemed strange to me. I was learned that  JavaScript’s true home was in the <head> element. In fact, many samples still promote this approach.

    So why should you put it at the bottom of the page?   Therefore we have to look at the way that a browser works. When a browser loads a document there are only so many thread for processing the document. So any time the browser spends parsing JavaScript is time it could be using to make the page look right.  Also, with some browsers, when the browser is loading JavaScript, ALL OTHER ACTIVITY STOPS.  Nothing else is downloaded, the browser is at a standstill until all the script is parsed.

    For simple pages, it doesn’t make a noticeable difference.  But if you have a lot of JavaScript on the page, the responsiveness impact could be significant.  

    CRUD based SOA

    Most IT oriented attempts to implement SOA I have seen end up as glorified CRUD systems pulling data to and from databases.  This leads to tightly coupled systems that rapidly degrade into Big Balls of Mud. If I contrast this to the few successful attempts I’ve seen, they had one commonality: they were all ‘message based’.

    While messages share some characteristics of service interfaces, they differ mostly in their granularity and lack of dependence upon one another. Messages allow true decoupling, where traditional service layers only promise this and usually end up creating even more tightly coupled systems. This separation of concerns allows development teams to concentrate on component parts with little impact upon other teams, and no more reliance upon them than an agreement on the messages they will listen for and those they will publish.

    Of course the question remains if IT is the right department to promote a SOA approach. Often decisions about software architecture become the underlying drivers for the entire IT department, instead of providing a framework to create business value.

    The boy scout rule

    As a kid, you maybe went camping with the boy scouts. One of the important camping rules is to  always leave the camp site cleaner than you found it, even if you have to  clean up someone else's mess!

    The same thing is true for code. So if you are refactoring, debugging, … and you find some messy code, always clean up(especially if the code was written by the lead architect :-). In time this will make an ugly code base better and more developer friendly.

    eer3a-uniform.jpg (53873 bytes)

    Problem when using stored procedure in Linq to SQL

    A while ago, I tried to add a stored procedure to the dbml file using the Linq to SQL designer. However it failed with the following error message:

    linqtosqlerror

    The Linq to SQL designer queries the stored procedure for metadata information (in order to determine what to write to the dbml file). The warnings indicate that SQL Server was unable to determine the shape of the result set returned by the stored procedure.

    The only solution I found is to provide the mapping for such sprocs yourself. Just create a partial class for the Linq to SQL context and add the code to call the stored procedure:

       1:  [Function(Name="RVV.GetLeveringDataByLeveringId")]
       2:  public ISingleResult<LeveringData> GetLeveringDataByLeveringId([Parameter(DbType="NVarChar(20)")] string id)
       3:  {
       4:      IExecuteResult result = this.ExecuteMethodCall(this,         ((MethodInfo)(MethodInfo.GetCurrentMethod())), id);
       5:      return ((ISingleResult<LeveringData>)(result.ReturnValue));
       6:  }

    Developing applications for the Cloud

    The MSFT P&P folks are sitting with their head in the clouds. They have published a new article combined with full example applications and sample code:  Developing Applications for the Cloud on the Microsoft Windows Azure™ Platform,

    And of course you can continue reading with Moving Applications to the Cloud on the Windows Azure Platform which provides best-practices guidance for building cloud apps on Azure.

    An overview of the covered scenario’s in both guides:

    Common Scenarios diagram

    Ff966499.c5267dc6-0710-49c8-9abf-cf95ea5b26f0(en-us,PandP.10).png

    Managing configuration settings for multiple environments

    One of the design problems I encounter in each IT project is where to store the configuration settings. .NET offers a lot of options to store this information, with the app.config and web.config as the most obvious one.

    One problem with this approach is that you have to update these settings when you deploy your application to a different environment, a manual and error-prone process. Of course with the new web deploy feature in .NET 4.0, you’ll have the option to merge multiple web.config files together but this only works for web applications and you’ll need good knowledge of XSLT transformations.

    Another more simple solution is to store your environment specific configuration in the environment itself.

    If the only thing different in each environment is in one place, in one file in that environment, how easy will it be to tell what is different? By making the configuration for an environment live in the environment and in one place, you take the responsibility of managing the configuration away from the build process and put it in one known place…

    How do you manage your environment settings?

    Saturday, September 18, 2010

    MSBuild Extension Pack

    Want to maximize the benefits of your build server? Before you start creating your own custom build tasks, first have a look at the MSBuild Extension Pack.

    The MSBuild Extension Pack August 2010 Release is  available for download.

    TFS 2010 update available

    Microsoft released an update (KB 983578) for:

    • Team Foundation Server 2010
    • All Team Explorer 2010 clients

    Although it is called the Lab Management update it not only contains features for Lab Management but also for other TFS components.

    What's in the upgrade?

    Enables Visual Studio 2010 Lab Management functionality

    • Improves performance for Lab Management Workflow Wizard.
    • Improves performance for running automated test cases on Network Isolated Lab environments.
    • Fixes an issue in which a Test Controller service account that is the same as a Lab Service account causes issues with environment capabilities.
    • There is a new Expression Encoder 4.0 based Video Diagnostic data adapter to collect video recording when you perform tests. This diagnostic adapter replaces the Windows Media Encoder base video diagnostic adapter.

    Install/Upgrade

    • Labels created in TFS2008 do not contain items after migration to TFS 2010 under certain rename/delete conditions.
    • TFS Cannot be re-installed (ATOnly) targeting a database that was patched before.
    • Tfs2010Beta2ToRTM operation is not executed when RC database is upgraded by post RTM server (RTM + Patch1 or SP1).

    TFS Build

    • VS2008 “smart device” projects pick up the 2010 MSTEST rather than the 2008 one.
    • Unavailable build agents are pinged indefinitely rather than giving up after an hour.
    • Duplicate changeset listings in build report.
    • Test results for VS2008 solution not published in case of a failed test.
    • Cannot delete build drops if a controller goes down
    • Open Process File Location” grayed out on menu- right click on a build definition when connected to a TFS 2008 server

    Version Control

    • Branch from label has been removed in TFS 2010 – now it’s back.
    • Convert folder to branch on a hierarchy root folder with children and cycle renames crashes VS.
    • Unshelve reports bogus errors about a null DownloadUrl when dependent renames are shelved and child item names overlap.
    • Incorrect query plan on QueryPendingChanges when querying all users pending changes can lead to bad performance.
    • merge /discard in both directions causes unnecessary “empty” merges in future merge attempts.
    • Issue in merge causes a conflict not to be generated when there is a rename in the target and source.
    • Overly aggressive automatic detection of file encoding can result in inappropriate encoding mismatches during merges.

    Work Item Tracking

    • Work item queries containing references to deleted fields can cause a red X on the work items node.

    Team Web Access

    • Firefox Browser: "Link Selected Items to a New Work Item" and other dialogs don't launch pages successfully
    • Chrome Browser: Adding an attachment doesn't work
    • Chrome Browser: Select Query Dropdown doesn't work in Choose Work Items window
    • Chrome Browser: Retain/Delete a build in Build Report page will get an exception “Unexpected callback response”
    • Query Picker Web Part Incorrectly Renders List Items (Rows) in List View (Overflow DIVs) within WebKit-based Browsers (including Safari, Chrome, etc)

    The upgrade applies to

    • Visual Studio 2010
    • TFS Application Tier
    • Team Explorer 2010
    • Microsoft Test Manager (MTM)
    • TFS Build Controller
    • TFS Build Agent
    • TFS Test Controller
    • TFS Test Agent
    • TFS Lab Agent

    TFS 2010 Power Tools September version

    While I was on vacation, Microsoft released a new version of the Team Foundation Server Power tools(download the latest version here).

    The most important new features are:

    • Admin Console Backup/Restore Wizard
    • Enhancements to the Team Explorer functionality
    • Command line support for branch manipulation

    More detailed information on Brian Harry’s blog: http://blogs.msdn.com/b/bharry/archive/2010/09/09/sept-2010-tfs-power-tools-release-available.aspx

    ASP.NET Security Vulnerability

    A few hours ago Microsoft released a Microsoft Security Advisory about a security vulnerability in ASP.NET.  This vulnerability exists in all versions of ASP.NET.

    An attacker using this vulnerability can request and download files within an ASP.NET Application like the web.config file (which often contains sensitive data).

    At attacker exploiting this vulnerability can also decrypt data sent to the client in an encrypted state (like ViewState data within a page).

    More information about the issue and a workaround can be found on Scott Guthrie’s blog.

    Error while creating a new Team Project on TFS 2010

    When I tried to create a new Team Project on TFS 2010, the creation failed when I arrived at the Sharepoint part with the following error:

    Exception Stack Trace:    at Microsoft.VisualStudio.TeamFoundation.WssSiteCreator.HandleSiteCreation(WssCreationContextWrapper contextWrapper, XmlNode taskNode)

       at Microsoft.VisualStudio.TeamFoundation.WssSiteCreator.Execute(ProjectCreationContext context, XmlNode taskXml)

    Inner Exception Details:

    Exception Message: TF249033: The site template is not available for the locale identifier (LCID). The site template name is: VSTS_CMMI_2. The LCID is: 1033. (type SoapException)SoapException Details: <detail exceptionType="TeamFoundationServerException" />

    Exception Stack Trace:

    --- end Exception entry ---

    The reason was caused by a missing Sharepoint template with the name VSTS_CMMI_2 which wasn’t installed automatically after upgrading our TFS server to the 2010 version.

    To solve the issue, execute the following steps:

    • Log on to the old Sharepoint site you used before the TFS upgrade.
    • Click on Site Actions and choose Site Settings.
    • On the Site Settings page, click on Site Templates under Galleries.
    • Click on the correct template to download the STP file.
    • After downloading the template package to your PC, log into the new SharePoint site.
    • Select Site Settings from the Site Actions rollover menu.
    • Select Site Templates from the Galleries column.
    • Select Upload. If you have multiple templates you would like uploaded, select Upload Multiple Files from the Upload rollover menu.
    • Browse for template(s) you would like uploaded, then click OK.
    • Your template(s) have been uploaded.

    Building Silverlight projects on a 64bit build server

    If you are building Silverlight projects on the ISOAPP502 build server, it’s possible that the build will fail with following error:

    C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets (101): The Silverlight 3 SDK is not installed.

    C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v3.0\Microsoft.Silverlight.Common.targets (101): The Silverlight 3 SDK is not installed.

    C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets (104): The Silverlight 4 SDK is not installed.

    C:\Program Files (x86)\MSBuild\Microsoft\Silverlight\v4.0\Microsoft.Silverlight.Common.targets (104): The Silverlight 4 SDK is not installed.

    At first you should think that the SDK wasn’t installed on the build server. But connecting to the build server confirmed that the SDK was available.

    The reason of the failure had to be found somewhere else. It is caused by the fact that the new build engine runs by default in a 64bit process. As Silverlight applications only support 32bit, you’ll have to update your build definition.

    Therefore:

    1. Open Team Explorer 2010
    2. Open the Builds section on your Team Project.
    3. Right click on the build definition and choose Edit Build Definition.
    4. In the Build Definition go to the Process tab.
    5. Click Advanced and change the MsBuild Platform option from Auto to X86.

    Debugging MSBuild scripts

    Creating and testing MSBuild scripts is not so easy. To help you, the MSBuild team created a series of blog posts that explain you how to debug your MSBuild scripts:

    A great starter to simplify MSBuild development!

    Managing build-level permissions in TFS 2010

    In TFS 2010, the security permissions have been re-arranged. This means that for your upgraded projects, users who are project administrator no longer have permissions to manage the build by default.

    To change this permissions, you’ll have to open up the project in Team Explorer, right-clicking Builds, and then clicking Security. You can apply permissions to a specific build definition by right-clicking the build definition and then clicking Security. If you want to apply permissions to a build folder, right-click that folder, and click Security. Additionally, you can set these permissions by using the TFSSecurity command-line tool.

    More information on the MSDN website.

    Compiling a VS2008 project on a TFS2010 build server

    After upgrading to Team Foundation Server 2010, some Visual Studio 2008 project failed to build on the build server.

    In the build log file, I found the following error message:

    The type 'System.Func<TResult>' exists in both 'c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll' [D:\Builds\01 Development Core\Sources\Core\Business Process Layer\Core.Bpl\Core.Bpl.csproj

    The problem was caused by a bug in the build engine which is using the .NET 4 Workflow libraries. As this project was originally created as a workflow library, we end up with a conflict as both the .NET 4 workflow libraries and the .NET 3 libraries were loaded in the same process. As we were no longer using the workflow functionality in this project, I removed the references to the .NET 3.5 System.Workflow dll. But the build still failed…

    Further investigation showed that I not only had to remove the references but also open up the csproj file and remove the following line:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets" />

    Removing it solved the issue.

    Bring your database to the cloud

    Thanks to SQL Azure, using SQL server in the cloud isn’t difficult. However if you want to move your existing database to the cloud, there are some things you need to consider. Not all SQL constructs are supported in the Cloud. So how do you know if you can port your database?

    I found the following tool on codeplex: SQL Azure Migration Wizard. The SQL Azure Migration Wizard helps you migrate your local SQL Server 2005 / 2008 databases into SQL Azure. The wizard walks you through the selection of your SQL objects, creates SQL scripts suitable for SQL Azure, and allows you to migrate your data. It will also analyze SQL Profiler trace files and TSQL script for compatibility issues with SQL Azure.