May 2012 - Posts

On the panel at Tech.Days: Visual Studio 11 Online Event
Mon, May 28 2012 15:08

A while ago I recorded a video Visual Studio Team Foundation for Everyone, this forms part of Tech.Days: Visual Studio 11 Online Event, 28th June 2012, 1pm to 3pm. To lift the agenda from the MSDN site

This event will cover the key new features and capabilities that Visual Studio 11 offers software development teams, and the opportunity to ask questions to the UK Developer Tools team and partners. There’ll be something for almost anyone involved in software development, from Project Managers & Scrum Masters to developers and testers.

So if you have any questions on TEE or any of the new features VS/TFS11 why not register?

Skydrive pushes me over my broadband usage
Mon, May 28 2012 15:00

I got back from a trip away to find an unexpected bill for broadband  through the letterbox. I have paid about the same each quarter for broadband for a good while now, I don’t see much variation as I rarely use my home phone, then again who does?

This bill was nearly double, why?

I think it was mostly due to setting up Skydrive to mirror my family photos and video as a backup, though this can’t explain it all, but then again my son as found Roblox. In each month I went over my usage it was costing me £5 a 5Gb block. It adds up fast.

On calling BT I found I could upgrade my package to a larger allowance and it worked out less than £1 more. The most irritating thing was they had been emailing me about my usage on my BT provided email address, an address I have never used.

So the top tip is make sure your usage notifications go to an address you actually get .

DDD South West session on Unit testing in VS11
Sat, May 26 2012 7:04

Thanks to everyone who attended my session at DDDSW today. The session was completely demo driven so no slides to share, but the contents of the session is covered in the blog posts

Links for todays Typemock webinar
Tue, May 22 2012 7:39

Thanks to everyone who attended my Typemock Isolator and SharePoint session. The links I mentioned were

I will post a link to the recording as soon as it is made available

Upgrading our blog server from BlogEngine 2.5 to 2.6
Mon, May 21 2012 14:51

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.

New .NET usergroup in Leeds
Thu, May 17 2012 14:17

Please to say there is a new .NET usergroup leeds-sharp.co.uk in Leeds, their inaugural meeting is on the 31st of May. I hope to be able to make it if I am in Yorkshire that day.

A bit busy with upcoming presentations
Tue, May 15 2012 5:22

I am a bit busy with upcoming  presentations, all of which are free to attend

I think that is all for now; wow a looks worse when they are all written down in one place. I better get writing….

by But it works on my PC!
Filed under:
Interested in Windows 8 Development?
Sun, May 13 2012 10:15

Are you interested in Windows 8 Development?

Well if you are Black Marble are running  a free event on Windows 8 on the 30th of May in Leeds.

Also Jon Fowler, one of our development leads has just started a series of blog posts on converting Prims to .NET for Windows 8 metro style apps. This is all tied to his port of Prism to Metro which you can download from Codeplex

Enjoy….

DDD10 1st September 2012
Sat, May 12 2012 11:46

I see after a few days of issues the DDD10 site is back up and ready for submission. I have submitted a session, why don’t you – it will be fun!

  • 08/05 – Call for speakers opens
  • 02/07 – Call for speakers closes
  • 03/07 – Voting opens
  • 24/07 – Voting closes
  • 27/07 – Schedule opens
  • 30/07 – Registration opens
  • 01/09 – DDD10
by But it works on my PC!
Filed under: ,
Doing a webinar on Typemock Isolator and Sharepoint
Thu, May 10 2012 17:05

I am  presenting a webinar on Typemock Isolator and Sharepoint on the 22nd of May. For more details and to register see the Typemock site

A fix for my failure to login to TFSpreview.com problems
Thu, May 10 2012 4:49

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.

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
Wed, May 9 2012 10:45

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

More on using the VS11 fake library to fake out SharePoint
Sat, May 5 2012 9:35

I recently posted on how you could use the new fakes tools in VS11 to fake out SharePoint for testing purposes. I received comments on how I could make my Shim logic easier to read so though I would revisit the post. This led me down a bit of a complex trail, and to Pete Provost for pointing the way out!

When I did the previous post I had used SP2007, this was because I was comparing using Microsoft Fakes with a similar sample I had written ages ago for Typemock Isolator. There was no real plan to this choice, it was just what had to hand at the time. This time I decided to use SP2010, this was the process used that actually worked (more on my mistakes later) …

  1. Using a Windows 7 PC that did not have SP2010 installed, I created a new C# Class Library project in VS11 Beta
  2. I added a reference to Microsoft.SharePoint.DLL (this was referenced from a local folder that contained all the DLLs from the SP2010 14 hive and also the GAC)
  3. THIS IS THE IMPORTANT BIT – I changed the project to target .NET 4.0 not the default 4.5. Now, I could have changed to .NET 3.5 which is what SP2010 targets, but this would mean I could not use MSTest as, since VS2010, this has targeted .NET 4.0. I could of course have changed to another testing framework that can target .NET 3.5, such as nUnit, as discussed in my previous post in the VS11 test Runner.
  4. You can now right click on the Microsoft.SharePoint.DLL reference and ‘add fakes assembly’. A warning here, adding this reference is a bit slow, it took well over a minute on my PC. If you look in the VS Output windows you see a message the process is starting then nothing until it finishes, be patient, you only have to do it once! I understand that you can edit the .fakes XML file to reduce the scope of what is faked, this might help reduce the generation time. I have not experimented here yet.
  5. You should now see a new reference to the Microsoft.SharePoint.14.0.0.0.Fakes.DLL. and you can start to write your tests

image

So why did I get lost? Well before I changed the targeted framework, I had tried to keep adding extra references to DLLs that were referenced by the DLL I was trying to fake, just as mentioned in my previous post. This went on and on adding many SharePoint and supporting DLLs, and I still ended up with errors and no Microsoft.SharePoint.14.0.0.0.Fakes.DLL. In fact this is a really bad way to try to get out of the problem as it does  not help and you get strange warnings and errors about failures in faking the are not important or relevant e.g.

“\ShimTest\obj\Debug\Fakes\msp\f.csproj" (default target) (1) ->1>  (CoreCompile target) –> “\ShimTest\f.cs (279923,32): error CS0544: 'Microsoft.SharePoint.ApplicationPages.WebControls.Fakes.StubAjaxCalendarView.ItemType': cannot override because 'Microsoft.SharePoint.WebControls.SPCalendarBase.ItemType' is not a property

The key here is that you must be targeting a framework that the thing your are trying to fake targets. For SP2010 this should really be .NET 3.5 but you seem to get away .NET 4.0 but 4.5 is certainly a step too far. If you have the wrong framework you can end up in this chain of added dependency references that you don’t need and are confusing at best and maybe causing the errors nor fixing them. In my case it seem a reference to Microsoft.SharePoint.Library.DLL stops everything working, even if you then switch to the correct framework. When all is working you don’t need to add the dependant references this is all resolved behind the scenes, not by me adding then explicitly.

So once I had my new clean project, with the correct framework targeted and just the right assemblies referenced and faked I could write my tests, so now to experiment a bit more.

Thoughts on my Channel9 post
Sat, May 5 2012 3:49

After hearing my TEE video on Channel9 mentioned on Radio TFS I thought I should watch it through, I had only found time to do a quick look previously. This is all part of my on-going self review process, a form of self torture.

It seems the issues I mentioned last time are still there, I still too many err’s. The thing that stood out the most was I looked like a very shifty newsreader. My movement behind the table and losing eye contact with the camera were too noticeable too me.

This said I am happy with how it came out. It was great working with a professional crew and you can see how good they can make the video look with good lights, camera and  editing.

On the whole I am very happy with it, just need to ‘love the camera’ bit more.