.NET
A collection of blog posts about developing software in .NET
No comments yet.
No trackbacks yet.
Consultancy
about 1 week ago - No comments
Software Consultancy Serving the Greater Seattle Area Our consulting service is now open for business. We can help you with:- Business planning Program management Software Development for the Microsoft.NET platform Architectural advice and review Custom software development (offsite or onsite) Migrating web applications to ASP.NET MVC 2 Migration to Entity Framework 4 Complex threading using More >
Constrained parallelism for the Task Parallel Library
about 1 week ago - No comments
When developing .NET applications there is often the need to execute multiple background processes, for example, fetching and rendering different size thumbnails for images. Typically you queue actions like these onto the thread pool. But in the case of thumbnail generation you typically want to fetch a base image first and then perform the resize More >
Singleton tasks: A TaskFactory for the Task Parallel Library with ‘run-only-one’ semantics
about 1 week ago - No comments
When developing .NET applications there is often the need to execute some slow background process repeatedly. For example, fetching a feed from a remote site, updating a user’s last logged in time, … etc. Typically you queue actions like these onto the thread pool. But under load that becomes problematic as requests may be coming More >
GDI+ Image.FromFile has a problem – here’s how to fix it
about 1 month ago - No comments
In GDI+ you can call Image.FromFile to load an image from a file. BUT there are several issues with this call, the biggest being that GDI+ will keep the file open long after you are done with it. Here is an image loader that gets around this issue. If you are running a high volume More >
A simple redirect route handler for ASP.NET 3.5 routing
about 4 months ago - 1 comment
ASP.NET 3.5 Routing is a very powerful tool not just for registering routes for newer ASP.NET MVC applications but also for adding SEO friendly routes to older Webforms (ASPX) applications, or for routing multiple URLs to a single page. But that’s not all it can do. You can create your own IRouteHandler and then have More >
Why functional programming and LINQ is often better than procedural code
about 4 months ago - No comments
Functional programming is a relatively new component in the C# language. It can potentially replace for-loops in many situations with simpler code, but the question remains ‘what’s wrong with a good old for loop?’ Here are some of the reasons I think functional programming is important and in particular how LINQ can improve the readability, More >
Using Home Automation to Monitor Cable Modem
about 5 months ago - 2 comments
Some time ago I was having an issue with my cable modem connection. The connection was intermittent at certain times of day but fine otherwise. Calling the cable company with an intermittent problem is pointless: you get the standard answer “But it’s working fine now”. So, since I have the world’s smartest home automation system More >
10 reasons my O(n²) algorithm is better than your O(n) algorithm
about 5 months ago - No comments
OK, so it’s a controversial title, but the point I want to make is that programmers often get confused about the time complexity, i.e. order O() of an algorithm and performance. They will happily declare that their O(n) algorithm is so much better than someone else’s O(n²) algorithm as they rip out some simple, stable, More >
Development Tools and Libraries I use
about 5 months ago - No comments
Libraries and Code Snippets TweetSharp Predicate Builder for LINQ query building: http://www.albahari.com/nutshell/predicatebuilder.aspx Useful tools LinqPad http://www.linqpad.net/ Source Control Subversion with TortoiseSVN Continuous Integration JetBrains TeamCity, recently moved off CruiseControl.NET Deployment Subversion as a repository for binary images, custom deployment code Web Server IIS7 Useful articles PHP: http://devzone.zend.com/article/627
System.Data.UpdateException: A value shared across entities or associations is generated in more than one location. Check that mapping does not split an EntityKey to multiple store-generated columns
about 5 months ago - 5 comments
This Visual Studio 2010 RC bug is really causing grief. If you see the error message above, check your EDMX file. Visual Studio may have kindly inserted an extra StoreGeneratedPattern="Identity" into your EDMX file on a child table for the association back to the parent table. For example, this … <EntityType Name="ExceptionRecordData"> <Key> <PropertyRef Name="ExceptionDataUID" More >