But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

21. May 2012 20:51
by Richard Fennell
0 Comments

Upgrading our blog server from BlogEngine 2.5 to 2.6

21. May 2012 20:51 by Richard Fennell | 0 Comments

A week ago version 2.6 of BlogEngine.net was released. This has plenty of new features such as a new file manager  and image tools, but for us the most important was site aggregation.

As I posted about previously, we moved to BlogEngine from Community Server because we need multi blog hosting, but with BlogEngine 2.5 we had to write our own basic site aggregation by creating a custom theme that managed some RSS feed merging behind the scenes. Now with BlogEngine 2.6 this type of feature available out the box.

The upgrade process was OK, replace the contents of the IIS site folder with the new bits, set the SQL connection string, copy in our App_data and custom Themes and run an upgrade SQL script.

The only issue I had was that in this process it seemed I lost all our user accounts. A quick check showed the issue was our 2.5 setup was using the blogs\[blogname]\users.xml file to hold the user IDs for each blog, 2.6 was using the be_users SQL table. Now I think this was a by-product of our import process from Community Server.

The fix was not too bad

  • Complete the BlogEngine 2.5-2.6 upgrade
  • I now had a be_users table with a row for each blogs admin user, but no password set
  • Selecting a blog I opened the [IISroot]\App_data\blogs\[blogname]\users.xml file to find a couple of entries, one for the admin account and one for the blog’s owner

    <Users>
      <User>
        <UserName>Admin</UserName>
        <Password>abababababababababab#</Password>
        <Email>webmaster@blackmarble.co.uk</Email>
        <LastLoginTime>2007-12-05 20:46:40</LastLoginTime>
      </User>
      <User>
        <UserName>richard</UserName>
        <Password>zyzyzyzyzyzyzyzyzyzyzyzyz#</Password>
        <Email>richard@blackmarble.co.uk</Email>
        <LastLoginTime>2011-12-05 14:37:59</LastLoginTime>
      </User>
    </Users>
  • Firstly you need to login to the blogs using the default admin account (password admin). It is of course a good idea to reset your admin password and contact  email at this point.
  • Next go to the blog’s control panel users section and add a user matching the missing account, in my case an admin user called  Richard , you can also set the email address and the password if you know what you want, and the job is done.
    However in my case, though I knew what to set the admin user’s password to for the blog, I don’t know the blog owners old passwords. However setting these back is easy as all I had to do was copy the password hash block from the XML file and pasted it into the be_users password column newly created user account.

Once this was done we could all login with our existing accounts.

10. May 2012 12:52
by Richard Fennell
2 Comments

You do that that PS2 keyboard on that old PC, not a USB one

10. May 2012 12:52 by Richard Fennell | 2 Comments

Whilst using DBAN to clean down some very old PCs for disposal to new homes at good causes I hit a stupid gotcha.

I booted off the DBAN CDRom but could not continue beyond the first screen as it did not detect I had pressed the return key.

Turns out the PCs were so old that, though their BIOS allowed USB keyboards (and I could enter setup and edit BIOS settings with a USB keyboard) the Linux kernel on the CDRom could not detect them. Once I switched to an old PS2 keyboard it all worked fine.

I found the same problem when putting Ubuntu onto same PCs; during the install I had to use a PS2 keyboard, but once the install completed it was perfectly happy with a USB keyboard.

10. May 2012 10:49
by Richard Fennell
0 Comments

A fix for my failure to login to TFSpreview.com problems

10. May 2012 10:49 by Richard Fennell | 0 Comments

I use a number of site collections on the Azure hosted Team Foundations Service (http://tfspreview.com); I have just solved a problem that I could not login to one of them via Visual Studio (2010, Dev11 or also TEE 11, I tried then all), but I could login to my other collections. Also I could access the collection if I logged in via a browser, just not with VS; all very good for work item management, but not much help for source code check-ins.

The Problem

The problem was that when I loaded Visual Studio and tried to select the collection https://mycollection.tfspreview.com in Team Explorer the ‘Sign into Team Foundation Server’ form loaded and uploaded a few times whilst trying to redirect to an authentication provider. I then ended up with a TF31003 error. A retry or use of different credentials did not help

image

If a deleted the server from the list and tried to re-add it I got similar results, but ended up at the LiveID sign in screen, but just an error message and no means to enter details.

image

The Solution

The problem was due to cached LiveID credentials. It was suggested I clear IE9 cookies but this did not help. In the end I found the solution in the Credential Manager (Control Panel > User Accounts > Manage Users > Advanced > Manage Passwords).

I had recently installed Skydrive on my PC. This had stored a cached LiveID, the issue was it seems this cached Skydrive LiveID was being used to access TFSpreview. Unfortunately this was my personal LiveID not my work one. This personal LiveID had no rights to access the problem site collection, but I could get into the other collections because both my personal and work LiveID both had access.

So I deleted the offending cached LiveID and tried Team Explorer again and this time I was prompted for a LiveID (though the user name field did contain the wrong LiveID, I could correct it) and I could login.

image

I then loaded SkyDrive (which I had exited) it prompted me to re-enter my credential. It recreated it cached credentials and seemed happy.

Interestingly they did not seem to cause a problem this time, maybe it is an entry order issue?

I need to keep an eye on it.

9. May 2012 16:45
by Richard Fennell
0 Comments

TFS Build error, 'Index (zero based) must be greater than or equal to zero and less than the size of the argument list” when building XAML projects

9. May 2012 16:45 by Richard Fennell | 0 Comments

We had an interesting issue of late building a Surface2 application solution within a TFS 2010 build system. The solution built fine in VS2010 on both my development PC and also using VS2010 on my TFS build box (both Windows 7 64bit PC), so I know I had all the right SDKs in place. However if I built it via TFS 2010 Team Build I got the error

image

App.xaml (136): Unknown build error, 'Index (zero based) must be greater than or equal to zero and less than the size of the argument list…”

This error appeared after we added this new block of XAML code

<VisualTransition GeneratedDuration="0:0:0.2">
  <VisualTransition.GeneratedEasingFunction>
        <CircleEase EasingMode="EaseInOut"/>      - this was the line the error was reported on
  </VisualTransition.GeneratedEasingFunction>
</VisualTransition>

I assumed the issue was that Visual Studio was somehow able to resolve an assembly reference that MSBuild could not.

so to try to resolve this I copied the MSBuild command line that was being run by the TFS build from the build log and ran it in a command prompt on my build box. Happily I got the same error, so at least it was repeatable. I then removed options on the command line until I had the minimum to give the errors. I ended up with

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe "C:\Builds\7\Surface\External Concierge CI\Sources\BlackMarble Concierge.sln"

If I changed to

MSBuild.exe "C:\Builds\7\Surface\External Concierge CI\Sources\BlackMarble Concierge.sln"

the error when away, so it had to be the version of MSBuild. When I used the 32bit version (picked up by default via the PATH) all was OK, the 64Bit gave the error.

So my fix was just to force the build to run x86 and all was OK

image

2. April 2012 16:00
by Richard Fennell
0 Comments

Fix for problem faking two SPLists in a single unit test with Typemock Isolator has been released

2. April 2012 16:00 by Richard Fennell | 0 Comments

A blogged a while ago about a problem faking multiple SPList with Typemock Isolator in a single test. With the release of Typemock Isolator 7.0.4.0 you no longer have to use the workaround I documented.

You can now use the code if the originally planned, and it works as expected

   1: public partial class TestPage : System.Web.UI.Page
2: {
3: public TestPage()
4: {
5:  var fakeWeb = Isolate.Fake.Instance<SPWeb>();

7: Isolate.WhenCalled(() => SPControl.GetContextWeb(null)).WillReturn(fakeWeb);
8: 
9: // return value for 1st call
10: Isolate.WhenCalled(() => fakeWeb.Lists["Centre Locations"].Items).WillReturnCollectionValuesOf(CreateCentreList());
11: // return value for all other calls
12: Isolate.WhenCalled(() => fakeWeb.Lists["Map Zoom Areas"].Items).WillReturnCollectionValuesOf(CreateZoomAreaList());
13: }
14: 
15: private static List<SPListItem> CreateZoomAreaList()
16: {
17: var fakeZoomAreas = new List<SPListItem>();
18: fakeZoomAreas.Add(CreateZoomAreaSPListItem("London", 51.49275, -0.137722222, 2, 14));
19: return fakeZoomAreas;
20: }
21: 
22: private static List<SPListItem> CreateCentreList()
23: {
24: var fakeSites = new List<SPListItem>();
25: fakeSites.Add(CreateCentreSPListItem("Aberdeen ", "1 The Road, Aberdeen ", "Aberdeen@test.com", "www.Aberdeen.test.com", "1111", "2222", 57.13994444, -2.113333333));
26: fakeSites.Add(CreateCentreSPListItem("Altrincham ", "1 The Road, Altrincham ", "Altrincham@test.com", "www.Altrincham.test.com", "3333", "4444", 53.38977778, -2.349916667));
27: return fakeSites;
28: }
29: 
30: private static SPListItem CreateCentreSPListItem(string title, string address, string email, string url, string telephone, string fax, double lat, double lng)
31: {
32: var fakeItem = Isolate.Fake.Instance<SPListItem>();
33: Isolate.WhenCalled(() => fakeItem["Title"]).WillReturn(title);
34: Isolate.WhenCalled(() => fakeItem["Address"]).WillReturn(address);
35: Isolate.WhenCalled(() => fakeItem["Email Address"]).WillReturn(email);
36: Isolate.WhenCalled(() => fakeItem["Site URL"]).WillReturn(url);
37: Isolate.WhenCalled(() => fakeItem["Telephone"]).WillReturn(telephone);
38: Isolate.WhenCalled(() => fakeItem["Fax"]).WillReturn(fax);
39: Isolate.WhenCalled(() => fakeItem["Latitude"]).WillReturn(lat.ToString());
40: Isolate.WhenCalled(() => fakeItem["Longitude"]).WillReturn(lng.ToString());
41: return fakeItem;
42: }
43: 
44: private static SPListItem CreateZoomAreaSPListItem(string areaName, double lat, double lng, double radius, int zoom)
45: {
46: var fakeItem = Isolate.Fake.Instance<SPListItem>();
47: Isolate.WhenCalled(() => fakeItem["Title"]).WillReturn(areaName);
48: Isolate.WhenCalled(() => fakeItem["Latitude"]).WillReturn(lat.ToString());
49: Isolate.WhenCalled(() => fakeItem["Longitude"]).WillReturn(lng.ToString());
50: Isolate.WhenCalled(() => fakeItem["Radius"]).WillReturn(radius.ToString());
51: Isolate.WhenCalled(() => fakeItem["Zoom"]).WillReturn(zoom.ToString());
52: return fakeItem;
53: }
54: 
55: }

A check of the returned values shows

  • web.Lists["Centre Locations"].Items.Count returns 2
  • web.Lists["Map Zoom Areas"].Items.Count) returns 1

29. February 2012 19:26
by Richard Fennell
0 Comments

Installing the TEE11 Beta as an upgrade to the plug-in in Eclipse

29. February 2012 19:26 by Richard Fennell | 0 Comments

The big news today is is that Microsoft released the VS11 Beta, part of which is Team Explorer Everywhere (TEE). (Oh they also release something called Windows 8 too – whatever that is)

Whilst upgrading my TEE instance in Eclipse (Indigo) I hit the same gotcha as I had when I originally installed TEE (in Eclipse is in your ‘c:\programs files’). On Windows, if UAC is enabled you have to run Eclipse as administrator to do the plug-in else you get the error message.

image

As soon as you start Eclipse as administrator the upgrade works perfectly, you can then restart Eclipse as normal and all is OK

27. February 2012 00:46
by Richard Fennell
0 Comments

(Not) Using a Huawei E585 MIFI in the USA

27. February 2012 00:46 by Richard Fennell | 0 Comments

I have an unlocked Hauwei E585 MIFI that I use around europe, avoiding roaming charges for my UK mobile contract. I buy a local pay as you go SIM for the appropriate country and off I go.

I thought I would try the same here in the USA, where I am for the MVP Summit. I bought a T-Mobile data SIM, but it did not work so well.

Basically the issue is one of aerials it seems. The E585 does not have the aerials it needs to connect for data in the USA, best it can do is a 2G connection, and even this seems to have issues, as mentioned in this post, that you need a phone SIM and not a data SIM. The bottom line seems to be the E585 is 2100MHz/900MHz UMTS only, AT&T are 850Mhz UMTS, T-Mobile will work on EDGE (2G) only. Verizon is CDMA. So it just just not going to work.

So next we tried it in other devices

  • In a LG E900 Windows Phone 7 it worked fine as a MIFI, but again only 2G/Edge so a bit sloooow, OK for email, but that was all.
  • Next it was a Samsung Windows 8 table form the Build conference, this was better, seemed to be 3G speeds (the icons did not mention the network type), but could not share its network connection

So the top tip? I think I need a US Mifi

16. February 2012 17:57
by Richard Fennell
2 Comments

You don’t need to keep that old TFS server to support older versions of Visual Studio

16. February 2012 17:57 by Richard Fennell | 2 Comments

I have recently spoken to a number of people who were under the impression that older versions of Visual Studio could not connect to TFS2010. This is not the case. So for example you do not need to keep a TFS2005 running for your VS2005 clients.

Why you might ask does this question even come up? VS2010 can build any .NET 2.0 –> 4.0 project so why not upgrade all your projects to VS2010? The answer is that products such as Biztalk and SQL Business Intelligence use older versions of the Visual Studio Shell e.g. so for SQL 2008 BI you are using in effect VS/Team Explorer 2008. Though it must be said this issue is getting better currently a BI developer still ends up having to use VS 2008 (until SSDT arrives with SQL 2012)

Also some companies may just have a policy to stay on a version of VS for their own reasons.

Either way this is not a barrier to using TFS 2010. The key to getting these older versions of Visual Studio to talk to TFS2010 is only a matter of applying the correct patch sets, so for

All the products can be installed side by side.

Another point to note is that if you are using any of the TFS 2010 PowerTools and want the same features in old versions of Team Explorer you must also install the 2005 and/or 2008 PowerTools versions. Even if the 2010 PowerTools are installed, they will not be found by the 2005 or 2008 clients. The most common time you see this issue is when using check in policies.

For those of you working with VS2003 or VB6 all is not lost, you too can use TFS 2010, you just need Team explorer 2010 installed and the MSSCCI  provider

Hope this post clears up a bit of confusion.

4. February 2012 10:28
by Richard Fennell
0 Comments

Filtering in MDX Calculated Members

4. February 2012 10:28 by Richard Fennell | 0 Comments

BI development is not something I do that often, but from time to time you need to develop a custom report in TFS. I recently had to battle a MDX problem that someone who does more BI development I am sure why have had no issue with; but as with most of these blog posts (or my long term memory as I think of it) I thought it worth a post in case it helps anyone else

What I was trying to do was produce a table, as shown below, that would allow me to report for a project on the total estimated time in the requirements work items (an estimate made in the requirements planning phase of the project), the total original estimate in the tasks work items (the estimate made by the developers during iteration planning) and compare both with the actual completed time from the task work items.

Project Estimated Effort (from Requirements) Estimated Effort (from Task) Actual Effort (from Tasks)
Proj A 10 11 12
Proj B 15 14 21
Proj C 23 20 24
Proj D 9 10 10

 

The problem is that in the TFS warehouse both the requirement and task work item estimate in stored in the

[Measures].[Microsoft_VSTS_Scheduling_OriginalEstimate]

measure. In the MDX query I needed to add a pair of calculated measures that would filter for the two work item type.

This is where I stumbled, should I use IIF() or FILTER(). So I tried both. However, working in Report Builder 3 neither seemed to work. I seemed to end up with either an empty column or not filtering at all and showing the sum of all the work items estimates irrespective of the filter.

The first tip is stop work in Report Builder, this is great for making the report look good, but not the best for resolving MDX issues. Use the query tool within SQL Management Studio. As soon as I did this I saw some of my efforts were returning #Err. This explained my empty columns, Report Builder seemed to just swallow the #Err and give me an empty column.

A a bit more digging I found the form that did what I needed, and ended up with the following form for the MDX in the calculated measures

MEMBER [Measures].[EstimatedWorkForTasks] AS '([Measures].[Microsoft_VSTS_Scheduling_OriginalEstimate], [Work Item].[System_WorkItemType].[Task])'

By editing the MDX in SQL Management Studio it was fair quicker to develop and debug

image

Once I was happy with the MDX, I could cut and pasted it back into Report Builder and fix the layout of the report. And all without using either IIF() or FILTER().

31. January 2012 12:43
by Richard Fennell
0 Comments

Have you tried switching it on and off again? Go on be aggressive!

31. January 2012 12:43 by Richard Fennell | 0 Comments

We have been building ‘standard’ environments for our TFS Lab Management system. Environments that can be used for most of the projects we are involved in without too much extra setup e.g. a small domain controller VM and a Server VM with SQL and SharePoint. These environments have a series of snapshots so it can be used in a number of ways e.g if we just want SQL and IIS we just go back to a snapshot prior to SharePoint being installed.

When trying to deploy one of these environments we saw a couple issues.

Capacity

First we got the error that there was not a suitable host with enough capacity to host the environment (remember all the VMs in a network isolated environment need to be on the same Hyper-V host). This can be a bit of a red herring as with dynamic memory and other new Hyper-V features there is often the capacity there (see Tiago’s post on this for more details). The fix here was to set TFS to allow aggressive deployment using the command

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig lab /hostgroup /collectionName:myTpc  ​/labenvironmentplacementpolicy:aggressive /edit /Name:"My hosts group"

Initial Startup

The next problem I saw was that when the new environment was deployed it did not started cleanly. The first time an environment is started it seems to take longer than subsequent starts (assume there is some initial configuration done). Basically in this case network isolation did not start correctly, hence build and testing capabilities also failed.

The fix was simple, shut down the environment and start it again. The tried and trusted IT answer to all problems. This time it started fine, and was faster to start.

Now I have not see this issue every time I deploy. When I deployed the same environment again and it worked perfectly first time. I suspect it was really a capacity issue on the underlying Hyper-V server causing some delay, but I am running in aggressive mode so I should expect this.