Branching in TFS

Ahhh… I think I know what you’re running into.

Are you getting “The target item $/foo/sub cannot be under the source item $/foo”?

Basically, we don’t allow you to branch everything in a folder to a subfolder of itself. The branch itself would work, but subsequent merges would get…messy.

The way to deal with this is to create a single top-level folder directly under your team project (so, if your Team Project is “foo”, put all of your source in something like “$/foo/Main”); then, if you need multiple branches within the team project, you can branch $/foo/Main to $/foo/a, or $/foo/a to $/foo/a.1, etc.

Let me know if that will work for you or not; or especially if you’re seeing some other error when you attempt your branch.


Top ten things that waste my time in Windows Workflow

The reason for this list is I keep running into dodgy issues and keep spending time on them only to remember I had the same issue from 6 months ago (this list is for my personal use so I appologise if it doesnt not seem clear, it’s just to jog my memory!):

  1. I suffer compile hell and then I remember that IIS caches my DLLs in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files for my WCF service. I try everything and then I remember this after throwing my laptop against the wall. I recommend restarting IIS and delelting Temporary ASP.NET Files every time you recompile. I just dont trust what is being cached.
  2. Some of my DLLs may be set, by default, to copy local so the GAC doesnt get updated and I cant figure out what is going on.
  3. Always remember to separate each bit of functionality into separate projects. If you have it all in 1 project then VS 2008 parses the whole workflow every time and this takes ages.
  4. Work on a machine with loads of power, when I changed machines from a blade to a super dooper machine by development time increased by and 10*. Also, to deploy to Sharepoint rime decreased from about 40 seconds to about 6 sencinds..NICE!!!
  5. Always remember to do an “UPDATE SERVICE REFERENCE” on your WCF refs. It seems theses do not get updated sometimes and this caused datatype errors with little red errors in your workflow. This is also related to point 1 above (Temporary ASP.NET Files).
  6. Because workflow is so complex I recommend writing unit test on every layer other wise you will spend too long looking for issues in one layer when they could be raised elsewhere.
  7. If you change a SN.KEY file your Public key token changes. Pretty obvious but spend ages thinking I had another issue.
  8. Dont forget to map dependency activities declaratively to child activities. This is the most trustworthy way of passing data / properties between activities.
  9. If you get the designer cant load type errors that give you no info what so ever firstly do IIS reset, then delete Temporary ASP.NET Files then restart visual studio. Then recompile the repen the WF design surface. (sounds like over kill but worth the effort I reckon)
  10. Was having DLL hell and then I ran a visual studio CLEAN command on my Solution and the DLL hell went away.

Workflow Public Key Tokens

Sharepoint workflow assemblies must be strongly named. The feature installation requires that you indicate the publick key token for the workflow assembly. There are a number of hoops one can jump through in order to obtain this public key. Here’s some I’ve heard today:

* Drag the built assembly into the GAC, browse to the GAC, copy and paste the public key token from the explorer window;
* Drop to a command prompt, browse to the SDK/Bin directory, use the SN.EXE command line tool to retrieve the public key token, copy all the contents of the command window into notepad, find the public key entry, copy and paste into your xml file


You can be a lazy programmer like me and simply take the following steps:

* In Visual Studio
* Tools/External Tools
* Title: Get Public Key; Command: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sn.exe; Arguments: -Tp “$(TargetPath)”; use Output Window

Now you’ll have an option on your Tools menu called “Get Public Key.” Simply build your strongly named assembly, select Tools/Get Public Key and in the output window you’ll be presented with the public key token, simply copy and paste… wala lazy programming shortcut.

this is from: