-
UrlRewriting, .NET 2.0 SP1 and Search Engines
-
Having been caught out by this issue once again this weekend, I thought I'd better blog about it so I don't scratch my head searching around again for a third time!
If you've been getting some wierd "Cannot use a leading .. to exit above the top directory." exceptions occuring on your site (you *do* log those, don't you?), that you can't reproduce in the browser, stay tuned. The issue crops up with URL Rewriting in .NET 2 SP1 - and the reason I've hit this again is when our production server was upgraded to .NET 3.5... evidentally this installed the service pack as a side-effect. So much for our patching strategy.
Anyway, this triggered a flow of errors for "Cannot use a leading .. to exit above the top directory.", all stemming back to a call to System.Web.Util.UrlPath.ReduceVirtualPath - but apparently only for particular visitors to the site - specifically search engine bots, including Googlebot. The issue occurs, as far as I understand, because .NET is specifically targeting code to particular browsers - in this case, I believe the issue results because it knows the user-agent doesn't support cookies, and is therefore trying to work accordingly.
There are two workarounds out there.
1. In your web.config, add the following:
<authentication mode="Forms">
<forms cookieless="UseCookies" />
</authentication>
This will bypass the issue entirely - by telling .NET to always use cookies for authentication - but if you require forms authentication to work in a cookie-less scenario, then this won't work. So, on to option number 2
2. Create a .browser file to match the user agents that are causing the issue. Check out this article that describes how.
-
Get your tech events featured on MSDN UK and TechNet UK!
-
This announcement is well overdue, but better late than never!
After much hard work by the DPE team at Microsoft in the UK - thanks in particular go out to Clare - we've now integrated the Developer Fusion events feed with the Microsoft UK community pages. This means that anyone who submits a Microsoft technology-related event to Developer Fusion will also automatically appear on the MSDN and TechNet community pages too - talk about some great free exposure!
Any events on Developer Fusion also get automatically posted to Upcoming.
I'm also working with the larger user groups in the UK to ensure we can automatically pull in their events through the same feed format. If anyone would like more info on this, just get in touch.
-
Gotcha: "The specified metadata path is not valid." with ADO.NET Entities on Vista x64
-
For those of you foolhardy enough to be running Vista x64 (myself included!), VS 2008, and the latest build of the ADO.NET Entities framework... you may well hit the following error message:
The specified metadata path is not valid. A valid path must be either an existing directory, an existing file with extension '.csdl', '.ssdl', or '.msl', or a URI that identifies an embedded resource.
The catch is that apparently the designers are not supported on 64-bit machines. The workaround is to copy two files from %windir%\Microsoft.NET\Framework64\v3.5 to %windir%\Microsoft.NET\Framework\v3.5:
then restart Visual Studio and rebuild your solution.
Thanks to Tommy Williams @ MSFT (found on the forums)
-
Shared Printers across Windows Vista and Windows XP
-
Since getting a shiny new machine running Vista, I'd been having a bit of grief trying to get it to print to my Canon i6500 printer shared through another Windows XP machine. Vista has built-in support for the printer (running locally), but when trying to add it across a network, as the XP machine could not supply the correct 64bit Vista drivers, the Vista machine wasn't too happy - pointing to the correct location of the local device drivers didn't help either!
After sifting through various solutions - this was the one that worked for me.
On the Vista machine,
- Choose to add a local printer
- Create a new local port, and set its name so it matches the network share (\\server\name)
- Manually select the appropriate printer driver from the automatically supported set (or select an appropriate vista driver)
This then tricks Vista into thinking we have a local printer - so it can install the correct drivers - that actually redirects to the network printer.
I think this should work in the reverse direction too, if Windows XP is geting upset printing to a device shared through Vista.
Hope this helps someone!
-
Upcoming (Free) UK Developer Events
-
There's so many great events coming up all around the UK at the moment - and best of all, they're free. If you haven't tried one yet, check out the UK developer event listings to find one near you. Here are just a few
Jim Paterson describes the key features of db4o, and shows how to save objects in the database, use the db4o query mechanisms, control transactions and object activation, refactor databases, replicate data to a relational database and use db4o in a web app. You will also find out about extensive the developer resources provided by the db4o community.
Discover the multitude of solutions offered by a Microsoft® SharePoint® Server 2007 platform. Enjoy interactive breakout demonstrations as well as a buffet lunch. Demonstrations will focus on: data capture, enterprise content management, document management, search, forms server as well as business intelligence, dashboards and KPIs.
Monday, 15 October 2007, 19:00 - 21:00 in Birmingham, United Kingdom. Free to members. Non members can attend 2 meetings FOC. (NxtGenUG)
Intrepid Explorer Liam Westley takes a trip back in time as he dives into Windows and looks at developing Windows Services. Remember those? Well, in case you hadn't noticed they're all around us in the development world, but hard to see and hard to capture with a debugger! Liam shows us how we can make our lives easier when writing and working with Windows Services including some of the differences between NT and Windows Vista Services. Other gigantic things to see on the night : Pizza-o-sa...
Come along and find out what’s in store for both the ASP.NET platform and Visual Studio in the upcoming release. As web developers, there’s a lot to get excited about including many features you can take advantage of in your existing projects.
Black Marble present a seminar on SQL2008 with an Introduction for
IT Managers. This outlines the change in emphasis from "words and
numbers" to "sights and sounds"
-
Future of Web Apps in London - (plus 20% discount!)
-
Future of Web Apps have a run a great set of events in both the US and the UK - and there's one coming up in London on Oct 3-5. Just to give you a taster, there are speakers from
-
Digg
-
Flickr
-
Facebook
-
WordPress
-
FeedBurner
-
Yahoo
-
Adobe
-
Microsoft
Not bad eh? Even better - Developer Fusion has organised a 20% discount off the full ticket price, which brings the two day conference pass down to less than £200. Give me a shout too if you're going to attend - I'm planning to make it.
-
C#/VB.NET Code Translation tweak
-
I've been getting a *lot* of feedback recently over the changes we made to the C#/VB.NET code translation tools to try and tidy them up - but unfortunately broke a somewhat crucial ability to copy the code out in IE6! I'm still not sure why IE6 is so unhappy with the CSS and is preventing any sensible selection in the output page (any suggestions welcomed).
However, I've now implemented a "view plain source" and "copy to clipboard" option which should at least get around this for now!
-
Free Silverlight Training
-
If you've been wanting to get up to speed on Silverlight but haven't had the time yet - then you might be interested in this. Developer Fusion has teamed up with InnerWorkings to offer some totally free Silverlight training, to all Developer Fusion visitors.
We're also got, amongst others, a 15% discount on DevelopMentor training, and 10% discount on the source code and hosted version of Gemini (from CounterSoft) - the bug tracking system that the team behind dotnetnuke use. More details are available on our free member benefits page.
If you have any feedback, or offers of further discounts to our visitors, just get in touch!
-
Gotcha: HTTP_X_FORWARDED_FOR returns multiple IP addresses
-
I hit a small gotcha this evening. A visitor to Developer Fusion reported that they couldn't gain access to the site at all, because our IP address detection logic was failing. We were checking the "HTTP_X_FORWARDED_FOR" header for an IP address, before falling back to REMOTE_ADDR, turning the IP into a long integer, and doing an IP-to-country lookup in our database. Which seemed safe enough!
As it turns out, HTTP_X_FORWARDED_FOR can sometimes have a comma delimited list of IP addresses - so what we actually needed to be doing was take the last IP address in that list, before doing our conversion to an integer.
Thanks go out to Francois Botha, one of our visitors, for helping me track down this issue!
-
C# <-> VB.NET Converters Updated
-
We've just updated our free C# to VB.NET and VB.NET to C# converters on Developer Fusion - they're adapted from the neat little utilities within the free .NET IDE, #develop . They now keep your comments in tact too. Great for when you've found those bits of sample code in the wrong language! If you haven't come across them before, they're well worth a look.
[Update: They support generics now too!]