<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">James Crowley</title><subtitle type="html">Random thoughts from a ASP.NET developer and UK community leader</subtitle><id>http://weblogs.asp.net/james_crowley/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/james_crowley/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2007-03-14T14:12:00Z</updated><entry><title>Beware: Upgrade to ASP.NET MVC 2.0 with care if you use AntiForgeryToken</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2010/03/18/beware-upgrade-to-asp-net-mvc-2-0-with-care-if-you-use-antiforgerytoken.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2010/03/18/beware-upgrade-to-asp-net-mvc-2-0-with-care-if-you-use-antiforgerytoken.aspx</id><published>2010-03-18T13:02:00Z</published><updated>2010-03-18T13:02:00Z</updated><content type="html">&lt;p&gt;If you're thinking of upgrading to MVC 2.0, and you take advantage of the AntiForgeryToken support then be careful - you can easily kick out all active visitors after the upgrade until they restart their browser. Why's this?&lt;br&gt;For the anti forgery validation to take place, ASP.NET MVC uses a session cookie called "__RequestVerificationToken_Lw__". &lt;/p&gt;
&lt;p&gt;This gets checked for and de-serialized on any page where there is an AntiForgeryToken() call. However, the format of this validation cookie has apparently changed between MVC 1.0 and MVC 2.0. &lt;br&gt;What this means is that when you make to switch on your production server to MVC 2.0, suddenly all your visitors session cookies are invalid, resulting in calls to AntiForgeryToken() throwing exceptions (even on a standard GET request) when de-serializing it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;[InvalidCastException: Unable to cast object of type 'System.Web.UI.Triplet' to type 'System.Object[]'.]&lt;br&gt;&amp;nbsp;&amp;nbsp; System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +104&lt;br&gt;&lt;br&gt;[HttpAntiForgeryException (0x80004005): A required anti-forgery token was not supplied or was invalid.]&lt;br&gt;&amp;nbsp;&amp;nbsp; System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +368&lt;br&gt;&amp;nbsp;&amp;nbsp; System.Web.Mvc.HtmlHelper.GetAntiForgeryTokenAndSetCookie(String salt, String domain, String path) +209&lt;br&gt;&amp;nbsp;&amp;nbsp; System.Web.Mvc.HtmlHelper.AntiForgeryToken(String salt, String domain, String path) +16&lt;br&gt;&amp;nbsp;&amp;nbsp; System.Web.Mvc.HtmlHelper.AntiForgeryToken() +10&lt;br&gt;&amp;nbsp; &amp;lt;snip&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;So you've just kicked all your active users out of your site with exceptions until they think to restart their browser (to clear the session cookies).&lt;/p&gt;
&lt;p&gt;The only work around for now is to either write some code that wipes this cookie - or disable use of AntiForgeryToken() in your MVC 2.0 site until you're confident all session cookies will have expired. That in itself isn't very straightforward, given how frequently people tend to hibernate/standby their machines - the session cookie will only clear once the browser has been shut down and re-opened.&lt;/p&gt;
&lt;p&gt;Hope this helps someone out there!&lt;br&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7387774" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /><category term="ASP.net MVC" scheme="http://weblogs.asp.net/james_crowley/archive/tags/ASP.net+MVC/default.aspx" /></entry><entry><title>developerFusion community relaunches</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2008/10/04/developerfusion-community-relaunches.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2008/10/04/developerfusion-community-relaunches.aspx</id><published>2008-10-04T22:12:00Z</published><updated>2008-10-04T22:12:00Z</updated><content type="html">&lt;p&gt;As some of you will know, I've run the &lt;a href="http://www.developerfusion.com/" mce_href="http://www.developerfusion.com/"&gt;developerFusion community&lt;/a&gt; for many years now, as a part-time hobby. Now, some big changes are afoot! 2 months ago I packed in my day job to focus on the site full-time, and have now made the first big step and re-launched the site.&lt;/p&gt;&lt;p&gt;You can check it out at &lt;a href="http://www.developerfusion.com/" mce_href="http://www.developerfusion.com/"&gt;http://www.developerfusion.com/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This is just the first step along the road, but an exciting one (for me at least!). The new site is going to make it even easier for developers around the world to connect with each other, and discover what's going on in their local area - be that events, user groups, blogs or just general discussion. We'll also be bringing a wider range of technical articles and focused developer news.&lt;br&gt;&lt;/p&gt;&lt;p&gt;If you have any feedback, feel free to get in touch - the site is here for you! If you twitter, stay tuned at &lt;a href="http://twitter.com/developerfusion" mce_href="http://twitter.com/developerfusion"&gt;http://twitter.com/developerfusion&lt;/a&gt; for more updates.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6657904" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Community+News/default.aspx" /><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /></entry><entry><title>UrlRewriting, .NET 2.0 SP1 and Search Engines</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2008/05/26/urlrewriting-net-2-0-sp1-and-search-engines.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2008/05/26/urlrewriting-net-2-0-sp1-and-search-engines.aspx</id><published>2008-05-26T17:05:00Z</published><updated>2008-05-26T17:05:00Z</updated><content type="html">&lt;p&gt;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!&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;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.&lt;br&gt;&lt;/p&gt;&lt;p&gt;There are two workarounds out there.&lt;/p&gt;&lt;p&gt;1. In your web.config, add the following:&lt;/p&gt;&lt;p&gt;&amp;lt;authentication mode="Forms"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;forms cookieless="UseCookies" /&amp;gt;&lt;br&gt;&amp;lt;/authentication&amp;gt;&lt;/p&gt;&lt;p&gt;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&lt;/p&gt;&lt;p&gt;2. Create a .browser file to match the user agents that are causing the issue. &lt;a href="http://todotnet.com/archive/0001/01/01/7472.aspx" mce_href="http://todotnet.com/archive/0001/01/01/7472.aspx"&gt;Check out this article that describes how&lt;/a&gt;.&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6222525" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term="sp1" scheme="http://weblogs.asp.net/james_crowley/archive/tags/sp1/default.aspx" /></entry><entry><title>Get your tech events featured on MSDN UK and TechNet UK!</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2008/01/26/get-your-tech-events-featured-on-msdn-uk-and-technet-uk.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2008/01/26/get-your-tech-events-featured-on-msdn-uk-and-technet-uk.aspx</id><published>2008-01-26T16:14:00Z</published><updated>2008-01-26T16:14:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;This announcement is well overdue, but better late than never!&lt;/P&gt;
&lt;P mce_keep="true"&gt;After much hard work by the DPE team at Microsoft in the UK - thanks in particular go out to Clare - we've&amp;nbsp;now integrated the &lt;A class="" href="http://www.developerfusion.co.uk/Events/RSS.aspx?CountryCode=UK" mce_href="http://www.developerfusion.co.uk/Events/RSS.aspx?CountryCode=UK"&gt;Developer Fusion events feed&lt;/A&gt; with the Microsoft UK community pages. This means that anyone who &lt;A class="" href="http://www.developerfusion.co.uk/Members/SubmitReadme.aspx?type=Event" mce_href="http://www.developerfusion.co.uk/Members/SubmitReadme.aspx?type=Event"&gt;submits a Microsoft technology-related&amp;nbsp;event to Developer Fusion&lt;/A&gt; will also automatically appear on the &lt;A class="" href="http://msdn2.microsoft.com/en-gb/aa497440.aspx" mce_href="http://msdn2.microsoft.com/en-gb/aa497440.aspx"&gt;MSDN&lt;/A&gt; and &lt;A class="" href="http://technet.microsoft.com/en-gb/bb291006.aspx" mce_href="http://technet.microsoft.com/en-gb/bb291006.aspx"&gt;TechNet&lt;/A&gt; community pages too - talk about some great free exposure!&lt;/P&gt;
&lt;P mce_keep="true"&gt;Any events on Developer Fusion also get&lt;A class="" href="http://upcoming.yahoo.com/group/3377/" mce_href="http://upcoming.yahoo.com/group/3377/"&gt; automatically posted to Upcoming&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;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.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5656218" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Community+News/default.aspx" /></entry><entry><title>Gotcha: "The specified metadata path is not valid." with ADO.NET Entities on Vista x64</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2008/01/26/gotcha-quot-the-specified-metadata-path-is-not-valid-quot-with-ado-net-entities-on-vista-x64.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2008/01/26/gotcha-quot-the-specified-metadata-path-is-not-valid-quot-with-ado-net-entities-on-vista-x64.aspx</id><published>2008-01-26T16:09:00Z</published><updated>2008-01-26T16:09:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;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...&amp;nbsp;you may well hit the following error message:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;EM&gt;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.&lt;/EM&gt; &lt;/P&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;SPAN&gt; 
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV align=left&gt;Microsoft.Data.Entity.Build.Tasks.dll&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV align=left&gt;Microsoft.Data.Entity.targets&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P align=left&gt;then restart Visual Studio&amp;nbsp;and rebuild your solution.&lt;/P&gt;&lt;/SPAN&gt;
&lt;P mce_keep="true"&gt;&lt;SPAN&gt;Thanks to Tommy Williams @ MSFT (&lt;A class="" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2532468&amp;amp;SiteID=1" mce_href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2532468&amp;amp;SiteID=1"&gt;found on the forums&lt;/A&gt;)&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5656175" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>Shared Printers across Windows Vista and Windows XP</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/10/28/shared-printers-across-windows-vista-and-windows-xp.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/10/28/shared-printers-across-windows-vista-and-windows-xp.aspx</id><published>2007-10-28T14:50:00Z</published><updated>2007-10-28T14:50:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;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&amp;nbsp;printer shared through another Windows XP machine. Vista has built-in support for the printer (running locally), but when&amp;nbsp;trying to add it across a network, as the XP machine could not supply the correct 64bit Vista drivers, the&amp;nbsp;Vista machine&amp;nbsp;wasn't too happy - pointing to the correct location of the local device drivers didn't help either!&lt;/P&gt;
&lt;P mce_keep="true"&gt;After sifting through various solutions - this was the one that worked for me.&lt;/P&gt;
&lt;P mce_keep="true"&gt;On the Vista machine,&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;- Choose to add a local printer&lt;BR&gt;- Create a new local port, and set its name so it matches the network share (&lt;A href="file://server/name"&gt;\\server\name&lt;/A&gt;)&lt;BR&gt;- Manually select the appropriate printer driver from the automatically supported set (or select an appropriate vista driver)&lt;/P&gt;
&lt;P mce_keep="true"&gt;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.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I think this should work in the reverse direction too, if Windows XP is geting upset printing to a device shared through Vista.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hope this helps someone!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4801519" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="XP" scheme="http://weblogs.asp.net/james_crowley/archive/tags/XP/default.aspx" /><category term="Vista" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Vista/default.aspx" /></entry><entry><title>Upcoming (Free) UK Developer Events</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/10/08/upcoming-uk-developer-events.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/10/08/upcoming-uk-developer-events.aspx</id><published>2007-10-08T08:03:00Z</published><updated>2007-10-08T08:03:00Z</updated><content type="html">
&lt;p&gt;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, &lt;a href="http://www.developerfusion.co.uk/events/" mce_href="http://www.developerfusion.co.uk/events/"&gt;check out the UK developer event listings to find one near you&lt;/a&gt;. Here are just a few &lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.developerfusion.co.uk/show/7088/" mce_href="http://www.developerfusion.co.uk/show/7088/"&gt;db4o: An Embeddable Database Engine for Object-Oriented Environments &lt;/a&gt;&lt;/h3&gt;
&lt;h5&gt;Wednesday, 10 October 2007, 19:00 - 21:00 in &lt;a href="http://www.developerfusion.co.uk/Events/Country/UK/" mce_href="http://www.developerfusion.co.uk/Events/Country/UK/"&gt;Glasgow, United Kingdom&lt;/a&gt;. FREE (&lt;a href="http://www.developerfusion.co.uk/show/5007/" mce_href="http://www.developerfusion.co.uk/show/5007/"&gt;Scottish Developers&lt;/a&gt;)&lt;/h5&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.developerfusion.co.uk/show/7001/" mce_href="http://www.developerfusion.co.uk/show/7001/"&gt;Microsoft® SharePoint® Server 2007 - Capture The Opportunity&lt;/a&gt;&lt;/h3&gt;
&lt;h5&gt;Friday, 12 October 2007, 10:00 - 14:00 in &lt;a href="http://www.developerfusion.co.uk/Events/Country/UK/" mce_href="http://www.developerfusion.co.uk/Events/Country/UK/"&gt;London, United Kingdom&lt;/a&gt;. FREE! (&lt;a href="http://www.developerfusion.co.uk/show/7000/" mce_href="http://www.developerfusion.co.uk/show/7000/"&gt;Content and Code&lt;/a&gt;)&lt;/h5&gt;
&lt;p&gt;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. &lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.developerfusion.co.uk/show/6984/" mce_href="http://www.developerfusion.co.uk/show/6984/"&gt;The Lost World: Win Services&lt;/a&gt;&lt;/h3&gt;
&lt;h5&gt;Monday, 15 October 2007, 19:00 - 21:00 in &lt;a href="http://www.developerfusion.co.uk/Events/Country/UK/" mce_href="http://www.developerfusion.co.uk/Events/Country/UK/"&gt;Birmingham, United Kingdom&lt;/a&gt;. Free to members. Non members can attend 2 meetings FOC. (&lt;a href="http://www.developerfusion.co.uk/show/6119/" mce_href="http://www.developerfusion.co.uk/show/6119/"&gt;NxtGenUG&lt;/a&gt;)&lt;/h5&gt;
&lt;p&gt;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...&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.developerfusion.co.uk/show/7107/" mce_href="http://www.developerfusion.co.uk/show/7107/"&gt;MSDN: What’s new in Visual Studio 2008 and .NET Fx 3.5 for the Web Developer &lt;/a&gt;&lt;/h3&gt;
&lt;h5&gt;Tuesday, 16 October 2007, 18:00 - 21:20 in &lt;a href="http://www.developerfusion.co.uk/Events/Country/UK/" mce_href="http://www.developerfusion.co.uk/Events/Country/UK/"&gt;Edinburgh, United Kingdom&lt;/a&gt;. FREE (&lt;a href="http://www.developerfusion.co.uk/show/5041/" mce_href="http://www.developerfusion.co.uk/show/5041/"&gt;Microsoft&lt;/a&gt;)&lt;/h5&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;h3&gt;&lt;a href="http://www.developerfusion.co.uk/show/7031/"&gt;SQL 2008 Your Data, Any Place Any Time&lt;/a&gt;&lt;/h3&gt;
&lt;h5&gt;Thursday, 18 October 2007, 09:00 - 13:00 in &lt;a href="http://www.developerfusion.co.uk/Events/Country/UK/"&gt;Bradford, United Kingdom&lt;/a&gt;. FREE (&lt;a href="http://www.developerfusion.co.uk/show/5095/"&gt;Black Marble&lt;/a&gt;)&lt;/h5&gt;
&lt;p&gt;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"&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4485972" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/james_crowley/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /><category term="winfx" scheme="http://weblogs.asp.net/james_crowley/archive/tags/winfx/default.aspx" /><category term="sql server" scheme="http://weblogs.asp.net/james_crowley/archive/tags/sql+server/default.aspx" /></entry><entry><title>Future of Web Apps in London - (plus 20% discount!)</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/09/25/future-of-web-apps-in-london-plus-20-discount.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/09/25/future-of-web-apps-in-london-plus-20-discount.aspx</id><published>2007-09-25T18:52:00Z</published><updated>2007-09-25T18:52:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;&lt;A class="" href="http://www.developerfusion.co.uk/show/7099/" mce_href="http://www.developerfusion.co.uk/show/7099/"&gt;Future of Web Apps&lt;/A&gt; have a run a great set of events in&amp;nbsp;both the US and the UK&amp;nbsp;- and there's one coming up in London on Oct 3-5. Just to give you a taster, there are speakers from&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Digg&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Flickr&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Facebook&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;WordPress&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;FeedBurner&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Yahoo&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Adobe&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Microsoft&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;Not bad eh? &lt;A class="" href="http://www.developerfusion.co.uk/show/7099/" mce_href="http://www.developerfusion.co.uk/show/7099/"&gt;Even better - Developer Fusion has organised a 20% discount off the full ticket price&lt;/A&gt;, which brings the two day conference pass down to less than £200.&amp;nbsp;Give me a shout too if you're going to attend - I'm planning to make it.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4145217" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /></entry><entry><title>C#/VB.NET Code Translation tweak</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/09/12/c-vb-net-code-translation-tweak.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/09/12/c-vb-net-code-translation-tweak.aspx</id><published>2007-09-12T21:29:00Z</published><updated>2007-09-12T21:29:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I've been getting a *lot* of feedback recently over the changes we made to the C#/VB.NET &lt;A class="" href="http://labs.developerfusion.co.uk/" mce_href="http://labs.developerfusion.co.uk/"&gt;code translation tools&lt;/A&gt; 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&amp;nbsp;(any suggestions welcomed). &lt;/P&gt;
&lt;P mce_keep="true"&gt;However, I've now implemented a "view plain source" and "copy to clipboard" option which should at least get around this for now!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3839966" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/james_crowley/archive/tags/C_2300_/default.aspx" /><category term="VB.NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/VB.NET/default.aspx" /><category term="visual basic" scheme="http://weblogs.asp.net/james_crowley/archive/tags/visual+basic/default.aspx" /></entry><entry><title>Free Silverlight Training</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/09/04/free-silverlight-training.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/09/04/free-silverlight-training.aspx</id><published>2007-09-04T15:00:00Z</published><updated>2007-09-04T15:00:00Z</updated><content type="html">&lt;p&gt;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 &lt;a href="http://www.innerworkings.com/promotions/c786f484-b556-4903-b395-4f1cbd610fd7/developer-fusion-silverlight-promotion" mce_href="http://www.innerworkings.com/promotions/c786f484-b556-4903-b395-4f1cbd610fd7/developer-fusion-silverlight-promotion"&gt;totally free Silverlight training&lt;/a&gt;, to all Developer Fusion visitors. &lt;br&gt;&lt;/p&gt;&lt;p&gt;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 &lt;a href="http://www.developerfusion.co.uk/Members/Benefits.aspx" mce_href="http://www.developerfusion.co.uk/Members/Benefits.aspx"&gt;free member benefits page&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;If you have any feedback, or offers of further discounts to our visitors, just get in touch!&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3732372" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="ajax" scheme="http://weblogs.asp.net/james_crowley/archive/tags/ajax/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /><category term="silverlight" scheme="http://weblogs.asp.net/james_crowley/archive/tags/silverlight/default.aspx" /></entry><entry><title>Gotcha: HTTP_X_FORWARDED_FOR returns multiple IP addresses</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/06/19/gotcha-http-x-forwarded-for-returns-multiple-ip-addresses.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/06/19/gotcha-http-x-forwarded-for-returns-multiple-ip-addresses.aspx</id><published>2007-06-19T21:00:00Z</published><updated>2007-06-19T21:00:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;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.&amp;nbsp;Which seemed safe enough!&lt;/P&gt;
&lt;P mce_keep="true"&gt;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. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Thanks go out to Francois Botha, one of our visitors, for helping me track down this issue!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2868581" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /></entry><entry><title>C# &lt;-&gt; VB.NET Converters Updated</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/06/09/c-lt-gt-vb-net-converters-updated.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/06/09/c-lt-gt-vb-net-converters-updated.aspx</id><published>2007-06-09T14:28:00Z</published><updated>2007-06-09T14:28:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;We've just updated our free&amp;nbsp;&lt;A href="http://www.developerfusion.co.uk/Utilities/convertcsharptovb.aspx"&gt;C# to VB.NET&lt;/A&gt; and &lt;A href="http://www.developerfusion.co.uk/Utilities/convertvbtocsharp.aspx"&gt;VB.NET to C#&lt;/A&gt; converters on Developer Fusion - they're adapted from the neat little utilities within the&amp;nbsp;free .NET IDE, &lt;A class="" href="http://www.icsharpcode.net/OpenSource/SD/" mce_href="http://www.icsharpcode.net/OpenSource/SD/"&gt;#develop&lt;/A&gt; . 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.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;[Update:&lt;/STRONG&gt; They support generics now too!&lt;STRONG&gt;]&lt;/STRONG&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2767995" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/james_crowley/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /><category term="VB.NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/VB.NET/default.aspx" /></entry><entry><title>BT Web21C SDK - Sending SMS, Voice Calls and Location Based Services</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/05/22/bt-sdk-sending-sms-voice-calls-and-location-based-services.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/05/22/bt-sdk-sending-sms-voice-calls-and-location-based-services.aspx</id><published>2007-05-22T20:43:00Z</published><updated>2007-05-22T20:43:00Z</updated><content type="html">&lt;P&gt;Another interesting side-point from the discussion this morning - Joe Black, director of Emerging Business and Technology at BT pointed me in the direction of their new &lt;A class="" href="http://sdk.bt.com/" mce_href="http://sdk.bt.com/"&gt;Web 21C SDK&lt;/A&gt; - available in .NET, Java, PHP and Python. What this does is exposes a load of functionality allowing you to integrate with their systems - including sending SMS, voice messages, conference calls, and location-based services. The service will ultimately work by purchasing "credits" for use within the system - but you're free to experiment within certain pre-set limits at no charge. &lt;/P&gt;
&lt;P&gt;There's also an interview of &lt;A class="" href="http://channel9.msdn.com/ShowPost.aspx?PostID=291580" mce_href="http://channel9.msdn.com/ShowPost.aspx?PostID=291580"&gt;two of the guys involved up on channel9&lt;/A&gt;, and some &lt;A class="" href="http://treeho.us/phoneymashups/" mce_href="http://treeho.us/phoneymashups/"&gt;demo "mashup"&amp;nbsp;apps using the technology&lt;/A&gt; - including one that will send you details of the nearest restaurants based on your location after&amp;nbsp;you send an SMS. &lt;/P&gt;
&lt;P&gt;Good stuff, and well worth a look!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2637294" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /><category term="Communication" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Communication/default.aspx" /></entry><entry><title>Microsoft Generational Roundtable</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/05/22/microsoft-generational-roundtable.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/05/22/microsoft-generational-roundtable.aspx</id><published>2007-05-22T20:24:00Z</published><updated>2007-05-22T20:24:00Z</updated><content type="html">&lt;P mce_keep="true"&gt;I took part in an interesting debate today,&amp;nbsp;organised by Microsoft, discussing&amp;nbsp;the latest generation of new graduates, their role in the IT industry - and&amp;nbsp;how they shape it, or are shaped by it. The discussion covered a broad range of issues, and definitely got those brain cells working! Some of the things raised were....&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;How our current education system stimulates (or fails to stimulate) innovation, and whether educational institutions - at all levels - could do more to support this.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Establishing&amp;nbsp;closer ties to business, at university level if not earlier - so students can engage with not only academics, but tap into the experience and knowledge of individuals with years of experience in the industry&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;How can we address&amp;nbsp;the huge gender gap in the IT industry - can&amp;nbsp;leading women within the industry to try to break down some of those preconceptions by engaging with potential students at an early stage?&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Moving towards a increasingly flexi-time, telecommuting business world&amp;nbsp;- will businesses that fail to adapt to accomodate their employees needs struggle to hold on to staff? How will this affect working hours?&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Looking forward to the next 5-10 years and how technology might further change the way we work.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;All in all, a very good morning, with some very interesting folks!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2637276" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="Community News" scheme="http://weblogs.asp.net/james_crowley/archive/tags/Community+News/default.aspx" /></entry><entry><title>Dynamically Generating PDFs in .NET</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/james_crowley/archive/2007/03/14/dynamically-generating-pdfs-in-net.aspx" /><id>http://weblogs.asp.net/james_crowley/archive/2007/03/14/dynamically-generating-pdfs-in-net.aspx</id><published>2007-03-14T13:12:00Z</published><updated>2007-03-14T13:12:00Z</updated><content type="html">&lt;p&gt;It&amp;#39;s perfectly possible to generate a PDF from scratch, using a library such as &lt;a href="http://sourceforge.net/projects/itextsharp/"&gt;iTextSharp&lt;/a&gt;, a port of a free Java PDF library. However, it can be hard work defining all the code you need to generate the layout you&amp;#39;re after, and impossible for someone to tweak the layout without going back to the developer. &lt;/p&gt;&lt;p&gt;One alternative, using the same free library, is instead to design a PDF document in a WYSIWYG environment such as Adobe Designer, and define some dynamic fields within the document. Your code can load this PDF form,&amp;nbsp;set the value of each of the fields, and output a flat PDF. This would enable you to, for instance, have an invoice PDF template defined, set a bunch of fields within the PDF, and output as a flat PDF document - without needing a load of code generating the PDF from scratch. &lt;/p&gt;&lt;p&gt;The code itself is very straightforward. We&amp;#39;re going to send the resulting output to the ASP.NET response stream, so we need to set the content-type and also a content-disposition header so that the result appears as a file download. &lt;/p&gt;&lt;p&gt;&lt;code&gt;Response.ContentType = &amp;quot;application/pdf&amp;quot;;&lt;br /&gt;Response.AddHeader(&amp;quot;Content-disposition&amp;quot;, &amp;quot;attachment; filename=tokens.pdf&amp;quot;);&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Note that we could just as easily be using a file stream, and would therefore replace the above with opening a stream to the appropriate file path. With that out of the way, we use a &lt;code&gt;PdfReader&lt;/code&gt; object to load our existing PDF from the local file system; in this case, from &lt;code&gt;~/assets/form.pdf&lt;/code&gt;. &lt;/p&gt;&lt;p&gt;&lt;code&gt;PdfReader pdfReader = new PdfReader(Request.MapPath(&amp;quot;~/assets/form.pdf&amp;quot;));&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Next we create a &lt;code&gt;PdfStamper&lt;/code&gt; object, which will allow us to modify the form fields defined in the PDF and save the result. We pass it the &lt;code&gt;PdfReader&lt;/code&gt; object representing the PDF file, and a stream we want the result sent to. Finally, we set the &lt;code&gt;FormFlattening&lt;/code&gt; flag so that we get a flat PDF rather than allowing the fields to remain editable. &lt;/p&gt;&lt;p&gt;&lt;code&gt;PdfStamper pdfStamper = new PdfStamper(pdfReader, Response.OutputStream);&lt;br /&gt;pdfStamper.FormFlattening = true; // generate a flat PDF &lt;/code&gt;&lt;/p&gt;&lt;p&gt;We can then set the dynamic fields defined within the PDF form, and close our &lt;code&gt;pdfStamper&lt;/code&gt; object. &lt;/p&gt;&lt;p&gt;&lt;code&gt;AcroFields pdfForm = pdfStamper.AcroFields;&lt;br /&gt;pdfForm.SetField(&amp;quot;InvoiceRef&amp;quot;, &amp;quot;00000&amp;quot;);&lt;br /&gt;pdfForm.SetField(&amp;quot;DeliveryAddress&amp;quot;, &amp;quot;Oxford Street, London&amp;quot;);&lt;br /&gt;pdfForm.SetField(&amp;quot;Email&amp;quot;, &amp;quot;anon@anywhere.com&amp;quot;);&lt;br /&gt;pdfStamper.Close();&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Closing the &lt;code&gt;pdfStamper&lt;/code&gt; object results in the PDF being written to the stream we passed in the constructor, and we&amp;#39;re all done. Simple! &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2025824" width="1" height="1"&gt;</content><author><name>James Crowley</name><uri>http://weblogs.asp.net/members/James-Crowley.aspx</uri></author><category term="asp.net" scheme="http://weblogs.asp.net/james_crowley/archive/tags/asp.net/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/james_crowley/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/james_crowley/archive/tags/.NET/default.aspx" /></entry></feed>