created a new IIS7 web site with Intergrated .net 4.0 app pool.
URLs ending with .aspx do show custom 404 anything else gives the blue server error page \"HTTP Error
answer was to use
and not to have any system.web customErrors
this worked for both .aspx and non .aspx requests.
bizarrely this combination did not come up in any of the blog posts and stackoverflow answers I had investigated, it was just luck I tried it.