Wednesday, October 29, 2008

ScriptResource.axd throws ArgumentOutOfRangeException

After doing a deployment from the build server in the NZ timezone to the production server in the US PST timezone I started seeing the following exception:

----
Exception information:
Exception type: ArgumentOutOfRangeException
Exception message: Specified argument was out of the range of valid values.
Parameter name: utcDate
Request information:
Request URL: https://www.mydomain.com:443/Site/ScriptResource.axd?blahdeblah
----

Turns out there were problems locating AJAX assemblies that, from the production servers perspective, were dated in the future.

The solution is to either wait for the timezone difference to sort itself out or to update the last modified date on the DLLS.

See the following link for an example of the latter.

Friday, October 3, 2008

Safari and Chrome "Red link" CSS bug

Came across a rather obscure CSS bug recently.

All the hyperlinks in the page were coming out red, regardless of the settings in the stylesheets. It was possible to change other properties, such as the background colour, but the text was always red in Safari and Chrome. IE7 and Firefox 3 showed the text as expected. It was like there was something overriding the defined styles.

Turns out the page in question had a CSS link in the HEAD tag to a file that didn't exist. The 404 page coming from IIS included styles to set the text to red. Somehow Safari and Chrome were using the styles defined in the 404 page as the CSS to be included. As the missing CSS file was the last in the list it was replacing the hyperlink colour.

Found another description of the problem here: CSS Advisor - Safari displays red links

Thursday, September 18, 2008

Compare schema between two databases

This is a bit rough, but the idea is to quickly find schema discrepancies between database1 and database2.
SELECT
 l.name, l.type_desc,
 m.name, m.type_desc
FROM database1.sys.objects as l
 full outer join database2.sys.objects as m on m.name = l.name
WHERE
   l.name is null or
   m.name is null

Wednesday, September 3, 2008

Tech Ed 2008

I think the song that was running on a loop in the corridors was by Opshop and is called Big Energy In Little Spaces

Tech Ed 2008 Day Three - DEV486 C# tips and tricks

Speakers: Jeremy Boyd, John Daniel Trask
  • PPTplex
  • Enum class to replace
    T blah = (T)Enum.Parse(typeof(T), value);
    
    with
    var blah = Enum.Parse(value);
    
    See EnumHelper using generics to reduce casting
  • Codeplex
  • Umbrella
  • Utilities.NET
  • IDesign.NET - FormHost
  • Fluent Interfaces E.g. 3.March(2003)
  • Extension Methods
  • static methods in a static class
  • Link Bridge
  • IEnumerable Extensions
    Foreach(Person person in _nodes.OfType<x>(Person)) {}
    
    using(TransactionScope scope = new TransactionScope())
    {
    }
    
  • Invariance Checking
  • Object Initializer E.g. new DataTable{CaseSensitive=false};

Tech Ed 2008 Day Three - DEV313 Microsoft Visual Studio 2008 IDE tips and tricks

Speaker: Kirk Jackson
  1. Disable save on create
  2. Track Active Item in Solution Explorer
  3. Save new projects when created
  • Shortcuts:
  1. Ctrl + shift + space - show parameters again
  2. Ctrl + shift + f - find in files
  3. F8 + shift F8 - Edit.Goto Next/Prev Location
  4. ? - Box selection
  5. Ctrl + shift + v Clipboard ring
  6. Ctrl / ">" - Command Window
  7. Ctrl + F6 - ?
  8. F11 - Fullscreen
  • Object Test Bench
  • http://blogs.msdn.com/saraford/

Tech Ed 2008 Day Three - WEB315 Object Oriented MS AJAX

Speaker: Scott Cate
  • Everything in Javascript is essentially a HashTable
  • String.format() from the AJAX library
  • Sys.StringBuilder
  • .apply(null, arguments);
  • Type.registerNamespace
  • Create methods with .prototype
  • Delegate
  • Events this.raiseEvent('overHeat', {OverMaxSpeed})