There appears to be an issue with the Windows Azure system where the AssemblyResourceLocator does not work correctly when the compiled assemblies of a site is uploaded to Azure from a timezone ahead of the Azure servers timezones. You can read about this issue at http://social.msdn.microsoft.com/Forums/en/windowsazure/thread/751e27a9-4108-4446-9870-411f409d2c08?prof=required&lc=1033
This issue presented itself in my application by failing to load any CSS for any of the Telerik controls I was using. Telerik loads it’s CSS using WebResource.axd. As I’m in Australia and the servers I uploading to are behind the Australian timezones, the call to the WebResource.axd would return a 404 error. Once the time on the server caught up to the compile time of my site assembly files, the CSS would start displaying.
I found 2 workarounds before finding a permanent solution.
Workaround 1: Change my PC’s timezone to Samoa (this first timezone in the list) and deploying my application. Obviously not ideal.
Workaround 2: Deploy the site to Staging and wait until several hours past and the site started working, then Swap VIP to Production. Also no ideal.
The solution I found to resolve the issue involved using the touch.exe app found at http://www.touchdotexe.com/ to touch the assembly dll file to update it to the current time on the server after the app had been deployed.
To do this I added the touch.exe file and a setup.cmd file to the root of my app, set the build action on the 2 files to Content and the Copy to Output Directory to Copy always.
I then added a startup task to the Azure Project’s ServiceDefinition.csdef file to execute the setup.cmd file at role startup.
<Startup priority="1"> <Task commandLine="setup.cmd" executionContext="elevated" taskType="simple" /> </Startup>
The setup.cmd file just has one line of code
As both of these files are copied to the bin folder, there’s no need to specify a full path the assembly file.