Visual Studio 2010 Beta 2 Setup

7. December 2009

This just makes my day:

My college finished the Visual Studio 2010 Beta 2 setup with this error.

Happy coding...

Microsoft Team System , ,

How to: Build .NET 1.1 code with TFS 2008.

30. November 2009

Recently Thijs Kroesbergen and I collaborated for the challenge to build .Net 1.1 code with a TFS 2008 build environment.

After configuring the build server we asked Captain Google what to do we implemented approach two described in the following blogpost and added one extra feature.


In approach two of Nagaraju's blog he modifies the output directory by adding an <ItemGroup> in the buildscript and writes the output to that directory in the After Compile Target Group. The problem with this solution is that the list of file in the ItemGroup ibeing initialized before the solution is being build. Therefore when your solution output changes the build will not pick this up the first time around. (This is a common "issue" with listing files in itemgroups, many have been tricked into this problem before)

 

By creating the ItemGroup at runtime (using an CreateItem taskthis problem will not occur. Here's how you do just that:


<CreateItem Include ="$(SolutionRoot)\**\bin\$(VS2003_Configuration)\**\*.*">

  <Output ItemName ="VS2003_OutputFiles" TaskParameter="Include"/>

</CreateItem>


The complete build script will look like this:


<PropertyGroup>

  <VS2003_Devenv>$(ProgramFiles)\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com</VS2003_Devenv>

  <VS2003_Configuration>Debug</VS2003_Configuration>

</PropertyGroup>


<Target Name="AfterCompile">

  <Exec Command="&quot;$(VS2003_Devenv)&quot; &quot;$(SolutionRoot)\Your .Net1.1 Solution.sln&quot; /build $(VS2003_Configuration)" />


  <CreateItem Include ="$(SolutionRoot)\**\bin\$(VS2003_Configuration)\**\*.*">

    <Output ItemName ="VS2003_OutputFiles" TaskParameter="Include"/>

  </CreateItem>


  <MakeDir

  Directories="$(BinariesRoot)\$(VS2003_Configuration)"

  Condition="!Exists('$(BinariesRoot)\$(VS2003_Configuration)')" />


  <Copy SourceFiles="@(VS2003_OutputFiles)"

  DestinationFiles="@(VS2003_OutputFiles->'$(BinariesRoot)\$(VS2003_Configuration)\%(RecursiveDir)%(Filename)%(Extension)')"/>

</Target>

 

Of course it would be better not to build .NET 1.1 code anymore and just upgrade your projects to a newer version of the .NET framework. From our .NET build jungle Thijs and I wish you happy coding... 

 

Microsoft Team System , , , , ,

Internal Errors using Check-in policies with TFS2008 and VSTS2005/VSTS2008

22. June 2009

Today I stumbled on a strange behavior of the Check-in policies on the Team Foundation Server (TFS2008). We are using the Work Items policy, Changeset Comments Policy and the Code Analysis Policy with a Custom Path Policy to ensure that documents that are stored in a different folder in source control don’t need a code analysis before checking in. The project members use Visual Studio Team System 2005 (VSTS2005) and Visual Studio Team System 2008 (VSTS2008) and have the corresponding TFS Power Tools installed on their development machines.

Every time a developer committed a check-in of source code while complying to all the above policies, TFS2008 fired a policy violation event. The Pending Changes – Policy Warnings screen showed an Internal error in …… policy for every check-in policy that was configured. This happened on both VSTS2005 and VSTS2008.

The source of this problem is in the fact that in this situation we had (re-)configured policies for the same Team Project with both VSTS2005 and VSTS2008. While the policies from both versions do the same, the logics (.dll files) have a different version for VSTS2005 and VSTS2008 and are stored on different locations on your hard drive. I guess that the references to the different versions of the .dll files that are stored on different locations is something VSTS doesn’t like.

The best way to avoid this error is to (re-)configure the policies from a VSTS2005 machine because VSTS2008 is backward compatible when it comes to check-in policies. If you use VSTS2008 all your VSTS2005 users will get errors that Code Analysis rules are missing if the Code Analysis Policy is enabled… 

TFS Errors , , , ,

BlogEngine.net content loads slowly

19. June 2009

After I installed BlogEngine.net 1.5 on my new web server the first thing I noticed was the long load time of the content. With the header and menu already showing on the internet browser, the content of my blog with just 3 post was between 10-20 seconds. Not something my readers would appreciate, would you?

Not being able to figure this thing out I was willing to delete this tool and search for something new when even Captain Google didn’t find a solution for me. But no worries, I have prevailed and found the solution in IIS.

If you use the same great blog and also experience long content load times, try to set the IIS .NET Trust Levels to Medium in the IIS Manager. Setting the trust level even lower and you will get an error message. Problem solved, case closed…

 

BlogEngine , , ,

What is a branch?

19. June 2009

A branch is what happens when your development team needs to work on two distinct copies of a project at the same time. For example:

Suppose your development team has just finished and released version 1.0 of your product. As you released version 1.0 you still have new cool features that need to be integrated in the new version of your product (version 2.0), but on the other hand you need to support your customers that are using version 1.0 of your product. The problem is that everybody on your team was focused on version 1.0, but with the support of this version and the development of version 2.0, you now have to lines of development you need to support.

The no nonsense solution to this problem would be that you make a copy of your entire repository and start the development of version 2.0 on that copy. It’s a solution, but not a perfect one. This approach becomes disappointing in situations where you want to apply a change to both trees. For example: every time a bug is fixed in the 1.0 maintenance tree, you probably also want to apply that same bug fix to the 2.0 development tree. As the fix becomes more complex, the more time it takes to apply the fix twice on both trees.

To resolve this time consuming work, source control tools support a feature which (in TFS) is called ‘branching’. Basically you fork your source code into two trees of source code called branches with the same history and the possibility that each of the two branches can evolve on its own. Because both branches have the same history a source control tool can track the changes between these branches and make it possible to merge changes between the two branches. 

‘A branch is like a puppy…’

Don’t create a branch unless you are willing to take care of it. The mechanics of branching in TFS are simplified to a single right click followed by a branch command. However, the total cost of branching is paid by reduced code velocity to the main branch, merge conflicts and additional testing can be expensive. So before you make a branch, be sure to know how the branch will support the development project.

So how do I determine the costs and benefits (ROI)

The costs

The main cost of a branch is in the time and potential for mistakes to be made during merges. Because eventually you have to perform one or more merge operations. Yes, the tool will make that merge easy, but you still have to do it.

The benefits

The greatest benefit is that branching enables parallel development by providing each development activity for the current release its own self-contained snapshot of needed source, tools, external dependencies and process automation. Such a self-contained snapshot effectively enables each development activity to proceed at its own pace, without taking any dependency on another.

But remember, a branch is like a puppy… if you create a branch with the intention of never merging to or from it, and never making changes to it, then you should not be creating a branch.

Once you begin thinking of branches in terms of cost and benefit I hope most teams will find a productive middle ground that gives them the right amount of branching to achieve their business goals.

A branch plan

The best way for creating a branch plan is to keep it simple. This is done by avoiding additional releases in the beginning (i.e. Service Packs and Hotfixes) and slowly begin the transition from a simple plan to a more complex branch plan as your product an business needs evolve into a more complex system of costs and benefits.

The situation described at the beginning of this topic (product version 1.0 that needs support and the integration of new features in version 2.0) is a perfect maintenance and development example for having a branch plan. But there are two common reasons to want to have a branch plan.

Sometimes a subset of your team needs to work on something experimental (i.e. a proof of concept or proof of technology) that will take several weeks. When they successfully finish, their work will be folded into the main tree, but in the meantime, they need a separate place to work.

The final reason to want to have a branch plan is when you want to use a dev-test-prod methodology. This is often called ‘code promotion’. The basic idea is that your code moves through three stages, ‘dev’ (products that is in active development), ‘test’ (products that is being tested) and ‘prod’ (products that are ready for a release to your customers). This model can work effectively but especially in larger companies where the roles of the team (developers, testers, operations) are very clearly separated.

Conclusion

Be afraid of branches, but not so afraid that you never use the feature. Don’t branch on a whim but do branch when you need a branch.

 

Microsoft Team System , , ,

TF200016: The following project does not exist: ‘Project Name’

18. June 2009

We’ve just done a migration of TFS2005 to TFS2008 and after a few tries we’ve managed to get it done. Except one nasty little detail... The TFS Reports.

When we begun with the TFS migration the repository contained over 65.000 work items and when we were done the repository still contained over 65.000 work items. But the TFS Report ‘remaining work’ gave us another story. The report reported a total of 7 work items in TFS.

So after spending some time processing the TFSWarehouse in the Analysis Server we noticed events in the event viewer with error code: TF200016: The following project does not exist: ‘Project Name’ every time we tried to process the TFSWarehouse.

This problem is caused by team projects that have been partly removed and where the source control folder is still visible in TFS2005. If you query for work items of the partly removed project in the TFS2005 environment you’ll still find the work items that are assigned to the deleted team project. The work items that are still assigned to the partly deleted team project are the root cause of this problem.

And now the solution:

  1. In the TFS2008 environment install the TFS2008 Power Tools;

  2. In the Team Explorer create a query that lists the work item id’s assigned to the partly deleted team project(s). Write these ID’s down, you’ll need them at step 5 below. 
    Note: These work item ID’s are unique at the server level, even across team projects.

  3. Map the source control folders of the partly removed team projects to a local workspace;

  4. Open Command Prompt an navigate to you workspace;

  5. Note: In Vista, make sure you open the Command Prompt with elevated privileges

  6. From this location execute the following command: C:\Program Files\Microsoft Team Foundation Server 2008 Power Tools\TFPT.exe DestroyWi /server:TfsServerName /WorkItemId:[Value 1],[Value 2] …
    Where TfsServerName is you Team Foundation Server name and the values are the ID’s you written down at step 2.

  7. Now you need to update the TfsWarehouse on the Analysis Server. To do this login to the TFS Server and navigate to the URL: http://localhost:8080/warehouse/v1.0/Warehousecontroller.asmx
    Click GetWarehouseStatus and verify that the warehouse status reports Idle. If it doesn’t just wait some time (not more than an hour) and try again.
    Important: It has to report Idle before proceeding to the next step.

  8. Go back to the ControllerService and click Run. You should get an XML message that reports the value: True

  9. Now you can monitor the process of the update by repeating step 6. When the Warehouse Status reports Running Adapters, the update is running. When it then reports Idle again, check your reports and everything should be back to normal.

 

TFS Errors , , , ,