Tag Archive for 'software'

Getting Jenkins to publish ASP.Net Web Projects with msbuild on Visual Studio 2010 files

I’m putting this here because there is a lot of google foo out there for this particular issue and none of the answers were from an authorative enough source for me to trust, so I just had to figure it out for myself.

The scenario

We have a Visual Studio Web Application solution that has been continually upgraded in the business for at least the last 7 years. It has been through several architecture changes and Visual Studio project format upgrades up to Visual Studio 2010 and ASP.Net 4. Having started as an original n-tiered architecture we have multiple layers of references/dependencies between projects roughly ordered as such:

  1. Third Party Binary References
  2. DAL layer
  3. Business Logic Layer
  4. Application Settings Transport project
  5. Web Application Application Layer

There is some cross referencing from projects at different layers further down than the one below it (the Web App has to reference some of the Third Party dlls).

We have been publishing the application manually through VS 2010 by rebuilding the whole solution manually using specific Build Configurations and then right-clicking on the web project and using the publishing wizard.

We recently tried to get Jenkins to automatically build and publish (we ended up using package deployment, not publishing) the application using an msbuild task and were unable to get either the transforms, or the correct binary dlls in the publish folder. This was causing us no end of pain.

The multiple causes and fixes

Just finding the correct msbuild command line to get it to work was chore. We ended up settling on:

msbuild $WORKSPACE\Website\Website.sln /v:$MsBuildVerbosity /p:Configuration=$PublishEnvironment /p:Platform="Any CPU" /p:DeployOnBuild=True /p:DeployTarget=Package /p:AutoParameterizationWebConfigConnectionStrings=False /p:AllowedReferenceRelatedFileExtensions=".pdb" /p:ExcludeGeneratedDebugSymbol=false /p:_PackageTempDir="$WORKSPACE\Publish\$PublishEnvironment\Website"

Once we got that right we had to actually do the following to get the correct output published with correct configs:

  1. Move the config transform task into the pre-build section from post-build section
    1. There seems to be a race condition in msbuild between the transforms and the file publish activity. Sometimes they would make it in, sometimes they wouldn’t.
  2. Move any post-build tasks in pre-build.
  3. Update every single non-GACed assembly or project reference to ensure they had the node <Private>True</Private> (this is the xml behind the Copy Local property in the reference properties screen)
    1. This is because VS 2010 sees the absence of the Private attribute as a default of Copy Local = True whereas msbuild sees it’s absence as defaulting to false
    2. This is an absolutely nutso decision from MS. Why on earth would you have the command line build system treat project properties differently than your IDE?
  4. Ensure every single referenced project (or reference project of a referenced project) has a consistent default build Configuration and Platform defined, and then define a solution Configuration that sets the default Project Configs for your release configuration.
    1. This is critical for us because we have an upstream platform branch that is read-only and externaled into the build/reference path for customer projects.
    2. The platform projects only have Debug and Release configurations for Any CPU platforms but the customer projects have build configurations to ensure the config trasnforms are generated (Dev, Test, Staging, Production).
    3. To make this work we had to define these four configurations in the solution file and map them to their corresponding projects in the customer projects but also map them to the Release configuration in the platform projects.

Thinking about a new virtualised infrastructure solution

So I’ve been a big fan of Virtualised Infrastructure from the early days, and have pretty much been a VMWare fan from the beginning. Then during my mono lurking days ChipX86 started working there and kicked off Review Board I gained a renewed respect for the company.

Back then I started with VMWare Server 2 or GSX, and used VMWare player extensively to do my Linux hacking off my windows machines. In the move to ESXi around version 4 I really fell in love with the power of the solution in particular with the power of the product running on a SAN with multiple connected host machines. The great thing about this is I could run paid ESXi on my SAN where it counted and then run up an ESXi free server for the virtualised development staging environments and the management tools would be on par between the two systems.

These days, with VM Technology being the way it is the gap between what can be done by the free version and the non-free version is getting bigger and bigger, and gets getting harder to work around that for the virtualised development environments we use at the office. I understand the VMWare’s need to do this, they need to have some reason to pay for their software, but the feature-set of other open-source virtualisation technologies have all but caught up to VMWare these days and it’s getting harder to ignore.

In particular I’ve been hearing great things about KVM, and thinking it would be good to try that as my development environment virtualisation infrastructure. I just didn’t want to run a whole machine up with the full linux user management to get the VM’s running. That’s why I’ve been thinking of trying Proxmox VE. It seems to be a vSphere work alike and supports many virtualisation formats including KVM. I just need to find the time to run up a Proxmox system and see how it goes for remote management, snapshot management and general VM performance. I think I’ll give it a crack soon.

Inception, defeat locked computers with encrypted disks through the firewire interface

http://www.breaknenter.org/projects/inception/

Got to say I’m impressed with how they thought this one up:

Inception’s main mode works as follows: By presenting a Serial Bus Protocol 2 (SBP-2) unit directory to the victim machine over the IEEE1394 FireWire interface, the victim operating system thinks that a SBP-2 device has connected to the FireWire port. Since SBP-2 devices utilize Direct Memory Access (DMA) for fast, large bulk data transfers (e.g., FireWire hard drives and digital camcorders), the victim lowers its shields and enables DMA for the device. The tool now has full read/write access to the lower 4GB of RAM on the victim. Once DMA is granted, the tool proceeds to search through available memory pages for signatures at certain offsets in the operating system’s password authentication modules. Once found, the tool short circuits the code that is triggered if an incorrect password is entered.

An analogy for this operation is planting an idea into the memory of the machine; the idea that every password is correct. In other words, the nerdy equivalent of a memory inception.

Been a while

My end-year’s resolution is to post more frequently about more cooler stuff.

In the mean time some things that I have been working on lately:

  • Been loving Jenkins as a CI tool for our ASP.Net e-commerce system at Ambliqueand it’s associated  plugins
    • Haven’t really gotten to the stage of uber customisation and it’s already proved incredibly invaluable
  • Been preaching the ways of systematic, thorough, documented testing since I started at Amblique,with early results a-showing
    • Only a matter of time before we go full ball to automate our testing system, most likely using Selenium
  • On the subject of testing systems been playing with and appreciating jmeteras a performance/load testing system
    • Just don’t go tyring to run a full ball performance test using the java UI, or you will bring the testing machine to a grind and get some really dodgey numbers
      • instead use the command line version
      • make sure to only have one listener/reporter (maybe the agregate report)
      • and pass in parameters like thread count (user count) and thread loops (test iterations) using the -Jproperty_name=value arguments
    • Oh and don’t try and use it to performance test Ajax ui’s, JMeter uses an html-as-xml-dom inspection approach to extract and test for assertions, and so doesn’t actually remote a browser (i.e. no javascript ability).

 

Looking for ASP.Net Mid-Level Developers

Hey guys, at Amblique, we’re looking to recruit several Mid-Level ASP.Net Developers.

To quote, the Atlassian guys, if you’re reading this blog then you probably already have the attitude we are looking for, but basically we want someone with a passion for application development on the web, who appreciates and understands where all the relevant web standards fit into the bigger picture, and who has serious experience working with the MS ASP.Net web stack (legacy or MVC).

Experience with SVN and some form of CI is an advantage, and SQL Server Experience is a must.

At Amblique we make websites that actually make our clients money using a in-house e-commerce system and the latest online development best practices. So from my perspective, we’ve got it all, the best pragmatic use of the right theory, in a market that is asking for results.

See the attached JD – Amblique ASP.Net Developer Roles - JD August 2011 (627).

Add a comment below or apply directly over on our website:

Awesome autonomous UAV with onboard Kinect

I secretly wanted to do this myself when I had the expendable income and time to buy and assemble a quadcopter and a kinect, especially since seeing the quadruino thing the other day. But now looks like I’ve been beaten to the punch

About me widget updated to work with WordPress 3.1

As mentioned here, the about me widget was broken in Wordpres 3.1 for a number of key reasons, which I had to fix;

  1. WordPress changed the way they bind the save event in the widgets.php form to use the jQuery().live(‘click’,…) call

    This subsequently caused my plugin to not be able to selectively unbind and rebind just the save button click event of the about me widget. Instead we had to unbind all the widget save button click events – due to a quirk in how jquery live() and die() methods work, and then bind a custom click event to all the widget save button click events, and then check the source widget that raised the event, so if it is the about me widget it then triggers an mce save and then calls the functions from the original save button click event.

  2. The version of tinyMCE shipped in WordPress 3.1 has an updated triggerSave() function that forces the form postback when called.

    This has the annoying sideaffect of breaking the ajax widget save event. So I changed the click event of the widget save button to call tinyMCE(editor).save() instead, which doesn’t force a form postback but does cause the rich text from the editor to be saved in the textarea.

So without further ado, I give you the latest version of about me widget, v2.2, compatible with WordPress 3.1.

Same disclaimer as for the last time I fixed the widget to work with WordPress v2.9.x.

About me widget is broken in WordPress 3.1

So it would seem that upgrading to WordPress 3.1 has broken the about me widget I co-maintain with Sam Devol.

Since I use this plugin on my blog I will actually be taking a look at it in the coming days/weeks/months depending on how busy my regular day job keeps me. First appearance seem to indicate yet another change in the way the ajax save button works on the widgets page causing borkage in the ugliness I had to use to get the widget to save correctly last time.

We might end up being locked in this duel with the WordPress widget page author’s for eternity methinks :(

Update: I’ve identified the cause, and to fix it will require yet another save click hack that I am reluctant to apply just yet. Have posted to wp-hackers to see if there are any alternatives to geting this fixed.

Testing multiple versions of IE on one Windows 7 machine

Great informative article on testing many versions of internet explorer on one machine, courtesy of IEBlog, full of useful links too.

It takes advantage of the Win7 XP mode virtualisation to run multiple internet explorer versions in XP VM’s. Apparently in the latest version it doesn;t even need to run on a CPU that is virutalisation enabled (i.e. works in software virtualisation).

Generating random sequences

Been doing this for years using Vecotrs (or ArrayLists as they are now called) for small enough lists. Didn’t stop to think that the dynamic array access (adding and removing) might in fact be killing the performance of the randomisation.

The Fisher-Yates Shuffle (or Knuth Shuffle).

To shuffle an array a of n elements:
  for i from n - 1 downto 1 do
       j <= random integer with 0 > j > i
       exchange a[j] and a[i]