Fabrice's weblog
Tools and Source
-
Solving URL rewriting problems with themes and trailing slashes
In a comment to an old post of mine about URL rewriting, a visitor named Tim has just asked how to solve a problem he was facing with ASP.NET themes and rewriting. The original post was addressing the main problems by using an overload of the RewritePath method introduced by .NET 2. Yet, a simple problem still existed: whenever URL rewriting is used with a URL like ~/somepath/ the theme gets broken because the path to the CSS files and other themed resources (like images) are wrong. The problem here is the trailing slash, which confuses the theme engine. A URL like ~/somepath works fine of course.
-
Visual Studio "Orcas" alpha
All the details are provided on the download page.
-
Mono available in a virtual machine
Want to try Mono? This is really easy now thanks to a VMWare image provided on the Mono download site. It includes Mono on Suse Linux.
-
Linq to Amazon source code
A while ago, I announced Linq to Amazon and started to describe how it's implemented. Actually producing some content for the book and summer holidays kept me busy for a while, but here is finally the last part of this series of posts.
In the previous post, I said that what had to be done to create the Linq extension is to implement the IQueryable<T> interface, and write the code that converts an expression tree into an Amazon query.
What I have done is just a quick and dirty implementation. The goal is not to provide a complete solution to query Amazon using Linq, but instead to create an example to give you an idea of how the Linq extensibility stuff works. As you will see by looking at the source code, a lot of work would be required for a complete implementation.
Let's describe what you'll find in the source code.
The BookSearch class implements IQueryable<Book>. This interface speaks for itself. An object that implements it can be queried for Book objects! A BookSearch instance is what we'll query. Our queries start with code like the following:
var query =
from book in new Amazon.BookSearch()
...
The important method to look for in the BookSearch class is CreateQuery<S>. This method receives an argument of type Expression. This is our expression tree. All that the CreateQuery<S> method does is creating and returning a new instance of the BookQuery class, passing the expression tree to its constructor. -
Visual Studio 2003 Service Pack 1 available
I'm working with VS 2005 these days, but I guess this can be helpful to someone: Microsoft has finally released a service pack for Visual Studio 2003. The list of fixed bugs and the release notes are available online.
-
CAB and SCSF resources
I've been extensively using the CAB (Composite UI Application Block) and the SCSF (Smart Client Software Factory) lately. You should really dig them if you are creating Windows Forms applications. The CAB is a great tool to structure your developments and create reusable components. The SCSF is great for working with the CAB...
-
Parsing WordML using Linq to XML
Eric White, Programming Writer for XLinq, MSXML, and XmlLite, shows how he used Linq to XML (XLinq) to query Word documents.
This is good example to get an idea of where Linq will help us. Linq comes with a set of features that greatly simplify the code needed to manipulate XML documents, either for querying them or for creating them.
Eric's post comes with the complete source code. I suggest you take a look at it so you can quickly make your own idea on Linq to XML.
You may also read this post by Steve Eichert, which highlights major improvements provided by Linq to XML.
Cross-posted from http://linqinaction.net -
Sandcastle alpha available, NDoc discontinued
Microsoft has released an alpha version of its technical reference documentation tool: Sandcastle.
Sandcastle is presented as a "documentation compiler for managed class libraries". The alpha is available for download. -
Why LINQ will succeed
In the official Linq forum, Joe Albahari presents the reasons why he thinks Linq will succeed:
I agree. Great summary.- LINQ syntax beats SQL syntax. SQL is flawed in that queries become exponentially difficult to write as their complexity grows. LINQ scales much better in this regard. Once you get used to it, it's hard to go back.
- Database queries are easily composable. You can conditionally add an ORDER BY or WHERE predicate without discovering at run-time that a certain string combination generates a syntax error.
- More bugs are picked up at compile-time.
- Parameterization is automatic and type-safe.
- LINQ queries can directly populate an object hierarchy.
- LINQ to SQL provides a model for provider independence that might really work.
- LINQ significantly cuts plumbing code and clutter. Without sweeping stuff under the carpet, like Workflow or Datasets. This is a credit to the design team.
- C# hasn't suffered in the process (in fact, it's gained).
Cross-posted from http://linqinaction.net -
New dates for Visual Studio 2003 and 2005 Service Packs
I've just noticed that the Visual Studio "Servicing" web page has been updated with new release dates for the Visual Studio 2003 and 2005 service packs: