Robert Hancock's Blog

The blog of Robert Hancock

Windows Store Application Multi Sideload

I am currently working on a large enterprise windows store application. The customer came up with an interesting requirement the other week. They wanted to be able to have multiple versions of the same store application deployed on the same device, so for example they could be running the current production version whilst also previewing the latest drop from a sprint.

Traditionally this had not been a problem with traditional client applications. However with the way windows store application work this was not as straight forward, normally you can only side load a single instance of a windows store application.

The solution

After putting some thought into this requirement and considering an option that would give the least impact to such things as automated build, I came up with the following solution.

Everything that determines the capabilities and general information on the Windows store application is stored in the Package.appxmanifest. By default this opens with a GUI interface in VS2013, underneath this interface it is just an XML file. I decided to look at what the raw XML shows.

I experimented with the XML found and found that if I simply changed the Identity name and gave it a new Guid I could have multiple versions of the same application running. On discovering this I decided that a post build event to switch the appxmanfest based on a solution configuration could do the job. I started by copying  the appxmanifest in my store application project and prefixing it with the word ‘dev’ in the file name. Visual studio will happily let you do this until you try to compile the project at which point you get an error stating that a store application project cannot contain 2 appx manifests.

image

To get around this error I created an xml file instead and called it Package.Dev.xml within the Windows store application project. Next I copied the XML from the appxmanifest and pasted it into Package.Dev.xml

To make it easier to identify instances it is probably best to also change the name and description of the application, even maybe go as far as changing the icon to distinguish versions.

image

Once you have done this right click the Windows store application project and select properties. Go to Build Events. Add the following xcopy command to the pre-build event command line

if "Dev"=="$(ConfigurationName)" xcopy "$(ProjectDir)Package.Dev.xml" "$(ProjectDir)Package.appxmanifest" /R /Y

image

The command has a conditional based on the configuration mode the project is built under. For this command to work you will need to create a new configuration and call it Dev in this case.

image

Create store applications with the debug configuration and then with the dev configuration. You should now be able to install both packages and have them both sideloaded.

image

Note if you just right click and deploy from VS it overwrote the apps for me, but if you right click your application project and create a windows store package and then run Add-AppDevPackage.ps1 it deploys the applications side by side.

If you want you can continue to add further xml files and append the to the list of pre build events to allow further multi side load instances

For our automated builds all I needed to do was specify the different configurations to build the corresponding app packages.

TFS 2012 & 2013 Kanban Board Link

The arrival of the Kanban board in TFS 2012 Update 1 was a great addition. One thing that has bugged me and customers I visit with this feature has been the missing link, or rather the confusion around the View board link. Teams that run with Kanban would expect that the View board link would navigate them to the Kanban Board. However the link is set to only ever navigate to the sprint board. In which case it would not be uncommon to see the following page:

image

As a workaround to this I decided to attempt writing a TFS Extension based on the great work Tiago Pascoal has done with the Team Foundation Task Board Enhancer. and from the 

My extension is very basic but hopefully useful Smile, by adding an additional View kanban board link to the Team home page.

image

Download

The latest version is available here

The extension should work with TFS 2012 Update 1 upwards, including TFS 2013 Preview.

License

As with Tiago’s extension this extension uses undocumented mechanisms and is in no way affiliated with Microsoft or guaranteed to work with any future versions of TFS.

The extension is free and comes with no warranties.

Installation

To install the extension, go to the administration page from Team Web Access

image

Click Control panel

image

Click the Extensions tab

image

Click Install

image

Browse to BlackMarble.Extensions.KanbanLink.min.zip. Click OK

image

BlackMarbe.Extensions.KanbanLink should appear in the Global Extensions section. Click enable.

image

Navigate to a Team Home page, A View Kanban board link should now appear on all Team pages.

Uninstall

To uninstall the extension. Navigate to the extensions section again. Click Uninstall

image

Powershell ISE–Windows 8

It’s been a while since I have used PowerShell on a client operating system. I have been running Windows 8 for a while now, but have not needed to use Powershell. I wanted to write a small Powershell and thought I would use the ISE (Integrated Scripting Environment) provided by Microsoft. I was surprised to find that when i hit the Windows key and searched for Powershell, the console appeared but nothing appeared for the ISE.

image

I thought it must be that I needed to enable a Windows feature or download it from Microsoft. Before trying both of those options I decided to fire up an instance of PowerShell and see if i could launch the ISE.

image

Which did launch the ISE for me.

image

As a shortcut if i type ‘Powershell ise’ in the start search box it will launch an instance of Powershell and execute the command to launch the ISE.

TFS 2012 - TfsSyncIdentities

Update 17/12/2012: Neno has now published his official 2012 version. The .exe can be found here

A number of our customers use the TfsSyncIdentities tool by Neno Loje. When running the TfsSyncIdentities on a 2012 instance the following error appeared:

image

I fired up an instance of ILSpy to try to understand what the application was doing. It turns out that the application is using a service reference to call to the JobService web service.

My guess was that the web service had changed in some way in 2012. I created a new console application in visual studio and copied the code from the Main method disassembled in ILSpy and placed it in my application. I then added a service reference to http://TFS:8080/tfs/TeamFoundation/Administration/v3.0/JobService.asmx. Once I added the required references, I had to change the following method call from:

   1: jobWebServiceSoapClient.QueueJobsNow(new Guid[]  
   2: {  
   3: Guid.Parse("544dd581-f72a-45a9-8de0-8cd3a5f29dfe")  
   4: }, true);]

To

   1: jobWebServiceSoapClient.QueueJobs(new Guid[]
   2: {  
   3: Guid.Parse("544dd581-f72a-45a9-8de0-8cd3a5f29dfe")  
   4: },true, 0);

Hit F5 and you should have a TfsSyncIdentities application that works with TFS 2012. When run against a 2010 instance the sync still ran successfully with the new version of the application.

image

TF31001–TFS Schema Version did not match the expected value

After updating my local test instance of TFS2010 to service pack 1 I came across the following error when trying to connect to a team project collection:

image

I launched the TFS Administration Console and selected the Default Collection from the Team Project Collections section, my first thought was to try stopping and starting the Default Collection. After shutting down the Team Project Collection I noticed under the status tab ‘Servicing Collection’ job had been queued for  some time for the Team Project Collection.

image

I launched services manager and found that the Visual Studio Team Foundation Background Job Agent was disabled. I enabled this service and rerun the job. After a minute or so the job changed from queued to success. Ensuring the Team Project Collection was back online I was able to successfully connect to the Team Project Collection.

TF203035–Create Branch from Label

For testing and demonstrations I have a basic installation of TFS2010 installed on my Windows 7 boot. Whist demonstrating the branching within TFS to a customer I came across an error when attempting to branch a folder by label:

image

Branching by label is something I do frequently in our production TFS environment so I was confident the issue had to be with my local TFS instance. After a quick search online one of the many suggestions relating to this error was a mismatch between versions of TFS 2010 and Visual Studio 2010. After checking the version of both products I found I had patched Visual Studio 2010 to service pack 1, however as my TFS installation was only for testing I had not ensured that the patch level was up to date.

Once I installed service pack 1 for TFS2010 I was able to branch a folder by a label successfully.

VSDBCMD - The target database schema provider could not be determined. Deployment cannot continue.

If you use Visual Studio Database Projects you may be familiar with the VSDBCMD utility to control the deployment of a database project.

Whilst testing a custom Team Foundation Server 2010 build template which included an activity to deploy a database project using the VSDBCMD, I came across the following error:

*** The target database schema provider could not be determined. Deployment cannot continue.

After looking into the error it turned out that the SQL Instance name in the connection string was incorrect. After resolving this issue the database project deployed to the SQL Instance as expected.