ASP.NET Hosting

Archives

Archives / 2006
  • Linq productization, where are we?

    I've been quiet on the blog side lately. So many things are keeping me busy!
    It's time to catch up a bit and share with you some information I collected over the last weeks. For example, here is the information we have today on the productization of Linq into Visual Studio "Orcas".

  • Removing diacritics (accents) from strings

    It's often useful to remove diacritic marks (often called accent marks) from characters. You know: tilde, cédille, umlaut and friends. This means 'é' becomes 'e', 'ü' becomes 'u' or 'à' becomes 'a'. This could be used for indexing or to build simple URLs, for example.
    Doing so is not so easy if you don't know the trick. You can play with String.Replace or regular expressions... But do you know .NET 2 has all that is required to make this easier?

  • 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.

  • 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.

  • 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

  • Why LINQ will succeed

    In the official Linq forum, Joe Albahari presents the reasons why he thinks Linq will succeed:

    1. 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.
    2. 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.
    3. More bugs are picked up at compile-time.
    4. Parameterization is automatic and type-safe.
    5. LINQ queries can directly populate an object hierarchy.
    6. LINQ to SQL provides a model for provider independence that might really work.
    7. 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.
    8. C# hasn't suffered in the process (in fact, it's gained).
    There are some bugs in the PDC – also some obstacles to implementing MetaModel and IDbContext without reverse engineering, but nothing unfixable. Looking forward to the release!
    I agree. Great summary.

    Cross-posted from http://linqinaction.net

  • Sandcastle, Microsoft's replacement for NDoc

    Microsoft listened to our requests. It has announced its upcoming tool for generating MSDN-like documentation from your .NET code. The codename is Sandcastle and the tool is presented as a "Documentation Compiler". It should work the same way NDoc does, except it will support .NET 2.
    The first release has been delayed and is now planned for August, as part of the next CTP release of the Visual Studio SDK.

  • Static method reflection

    .NET reflection features are powerful and this is really what makes it a powerful platform. We don't use reflection everyday, but when we do it's really useful.
    Don't you hate it though when you have to write code like this?:

    MethodInfo method = typeof(MyClass).GetMethod("MyMethod");


    The problem with this code is that we use a string to identify the method, which means that we don't get compile-time validation.
    Ayende has an interesting approach to this problem. He gives you a solution that allows writing the following code instead:

    MethodInfo method = GetMethod<int, string>(MyClass.MyMethod);

    In this case, everything is strongly-typed and checked by the compiler.

    Of course, nothing is perfect and this solution suffers from a number of limitations, but it's an interesting approach anyway. The limitations:

    • it works only with static methods,
    • the methods need to be accessible (public or in your code's reach),
    • we can't use a similar approach for properties.
    Maybe one day we'll get support for this right from the compiler. Currently, there is typeof for types, but we are out of luck for methods, properties or parameters...

    Update: Daniel Cazzulino has another option that is more complete.

  • Tools galore

    How many tools do you think we can use for .NET development?
    Well, more than 905 tools (including 292 libraries) according to what I have referenced in SharpToolbox so far! How many do you actually know? ;-)
    I started collecting this information more than three years ago now... It's been a while since I've taken a look at the counters.

    If I remember well, the latest categories that I've added are Grid computing, Workflow, Rich-client UI. The categories with the most tools are IDE - IDE-addins, Persistence - Data-tier, Reporting, Object-relational mapping, and ASP.NET.

    JavaToolbox is in good shape too with 558 tools including 196 libraries!

    Searching for a tool? Keep digging, I have most of them in store :-)

  • Linq to Amazon implementation fore steps

    On Monday, I have announced an implementation of Linq for Amazon Web Services, that allows to query for books using the following syntax:

    var query =
      from book in new Amazon.BookSearch()
      where
        book.Title.Contains("ajax") &&
        (book.Publisher == "Manning") &&
        (book.Price <= 25) &&
        (book.Condition == BookCondition.New)
      select book;


    Before getting to the details of the implementation code, I'd like to describe what we need to do in order to be able to use such code.
    First, as you can see we work with book objects. So, let's defined a Book class:

    public class Book
    {
      public IList<String>  Authors;
      public BookCondition  Condition;
      public String         Publisher;
      public Decimal        Price;
      public String         Title;
      public UInt32         Year;
    }

    Here I use public fields for the sake of simplicity, but properties and private fields would be better.
    You can see that this class defines the members we use in our query: Title, Publisher, Price and Condition, as well as others we'll use later for display. Condition is of type BookCondition, which is just an enumeration defined like this:

    public enum BookCondition {All, New, Used, Refurbished, Collectible}

    The next and main thing we have to do is define this BookSearch class we use to perform the query. This class implements System.Query.IQueryable<T> to receive and process query expressions. IQueryable<T> is defined like this:

    interface IQueryable<T> : IEnumerable<T>, IQueryable

    which means that we have to implement the members of the following interfaces:

    interface IEnumerable<T> : IEnumerable
    {
      IEnumerator<T> GetEnumerator();
    }

    interface IEnumerable
    {
      IEnumerator GetEnumerator();
    }

    interface IQueryable : IEnumerable
    {
      Type ElementType { get; }
      Expression Expression { get; }

      IQueryable CreateQuery(Expression expression);
      object Execute(Expression expression);
    }

    and finally the IQueryable<T> interface itself of course:

    interface IQueryable<T> : IEnumerable<T>, IQueryable, IEnumerable
    {
      IQueryable<S> CreateQuery<S>(Expression expression);
      S Execute<S>(Expression expression);
    }


    It may look like a lot of work... I will try to describe it simply so that you can create your own implementation of IQueryable without too much difficulty once you get to know how the mechanics work.

    In order to be able to implement IQueryable, you need to understand what happens behind the scenes. The from..where..select query expression you write in your code is just syntactic sugar that the compiler converts quietly into something else! In fact, when you write:

    var query =
      from book in new Amazon.BookSearch()
      where
        book.Title.Contains("ajax") &&
        (book.Publisher == "Manning") &&
        (book.Price <= 25) &&
        (book.Condition == BookCondition.New)
      select book;


    the compiler translates this into:

    IQueryable<Book> query = Queryable.Where<Book>(new BookSearch(), <expression tree>);

    Queryable .Where is a static method that takes as arguments an IQueryable followed by an expression tree.
    I can hear you crying out loud: "What the hell is an expression tree?!".
    Well, an expression tree is just a way to describe what you wrote after where as data instead of code. And what's the point?

    1. To defer the execution of the query
    2. To be able to analyze the query to do whatever we want in response
    In our case, we will go to the web and ask Amazon to return some XML data about books, but we could also translate the query into SQL and execute it against a database (this is what Linq to SQL does!), or do anything else you'd consider useful.

    And why is it called a "tree"? Because it's a hierarchy of expressions. Here is the complete expression tree in our case:

    Expression.Lambda<Func<Book, Boolean>>(
      Expression.AndAlso(
        Expression.AndAlso(
          Expression.AndAlso(
            Expression.CallVirtual(
              typeof(String).GetMethod("Contains"),
              Expression.Field(book, typeof(Book).GetField("Title")),
              new Expression[] { Expression.Constant("ajax") }),
            Expression.Call(
              typeof(String).GetMethod("op_Equality"),
              null,
              new Expression[] {
                Expression.Field(book, typeof(Book).GetField("Publisher")),
                Expression.Constant("Manning") })),
          Expression.Call(
            typeof(Decimal).GetMethod("op_LessThanOrEqual"),
            null,
            new Expression[] {
              Expression.Field(book, typeof(Book).GetField("Price")),
              Expression.Constant(new Decimal(25), typeof(Decimal)) })),
        Expression.EQ(
          Expression.Convert(
            Expression.Field(book, typeof(Book).GetField("Condition")),
            typeof(BookCondition)),
          Expression.Constant(BookCondition.New))),
      new ParameterExpression[] { book }));


    If you look at this tree, you should be able to locate the criteria we have specified in our query. What we will do in the next step is see how all this combines and how we will extract the information from the expression tree to be able to construct a web query to Amazon.
    We'll keep that for another post... Stay tuned!

    Cross-posted from http://linqinaction.net

  • Introducing Linq to Amazon

    As an example that will be included in the Linq in Action book, I've created an example that shows how Linq can be extended to query anything.
    This example introduces Linq to Amazon, which allows querying Amazon for books using Linq! It uses Linq's extensibility to allow for language-integrated queries against a book catalog. The Linq query gets converted to REST URLs supported by Amazon's web services. These services return XML. The results are converted from XML to .NET objects using Linq to XML.

    For the moment, let's look at the client code:

    var query =
      from book in new Amazon.BookSearch()
      where
        book.Title.Contains("ajax") &&
        (book.Publisher == "Manning") &&
        (book.Price <= 25) &&
        (book.Condition == BookCondition.New)
      select book;


    I think this code speaks for itself! This is Linq to Amazon code. It expresses a query against Amazon, but does not execute it... The query will be executed when we start enumerating the results.

    The following piece of code converts from Linq to Amazon to Linq to Objects:

    var sequence = query.ToSequence();

    The query gets executed this time and an enumeration of the resulting books is created.
    The next steps could be to use Linq to Objects to perform grouping operations on the results. e.g.:

    var groups =
      from book in query.ToSequence()
      group book by book.Year into years
      orderby years.Key descending
      select new {
        Year = years.Key,
        Books =
          from book in years
          select new { book.Title, book.Authors }
      };


    This allows to display the results like this:

    Published in 2006
      Title=Ruby for Rails : Ruby Techniques for Rails Developers    Authors=...
      Title=Wxpython in Action    Authors=...

    Published in 2005
      Title=Ajax in Action    Authors=...
      Title=Spring in Action (In Action series)    Authors=...

    Published in 2004
      Title=Hibernate in Action (In Action series)    Authors=...
      Title=Lucene in Action (In Action series)    Authors=...

    using the following code:

    foreach (var group in groups)
    {
      Console.WriteLine("Published in "+group.Year);
      foreach (var book in group.Books)
      {
        Console.Write("  ");
        ObjectDumper.Write(book);
      }
      Console.WriteLine();
    }


    What a great way to query a catalog of books! Don't you think that this code is very legible and clearly expresses the intention?
    Linq to XML can also be used to display the results as XHTML, and Linq to SQL can be used to persist the results in a database.

    Over the coming days, I'll publish more details and the complete source code for this example.
    Update: The next part of this series is available: Linq to Amazon implementation fore steps

    Cross-posted from http://linqinaction.net

  • Linq rebranding

    Soma announced that the naming scheme for the Linq technologies has been simplified:

    LINQ to ADO.NET includes:
          LINQ to DataSet
          LINQ to Entities
          LINQ to SQL (formerly DLinq)

    LINQ support for other data types includes:
          LINQ to XML (formerly XLinq)
          LINQ to Objects
    So long DLinq and XLinq... Welcome  Linq to Whatever!
    I agree that this will make things a bit more explicit, especially the separation between what is related to ADO.NET and what is not. It will also help implementors find names for their products using Linq. We can expect to see more LINQ to Something in the future...

    Cross-posted from http://linqinaction.net

  • ADO.NET Entity Framework documents are back (ADO.NET vNext)

    The original articles about the ADO.NET Entity Framework didn't stay online very long, but this time, two official documents are available:

    These documents will give you an overview of what is coming in the next version of ADO.NET, mainly the ADO.NET Entity Framework, which is Microsoft's upcoming solution for mapping data to objects.
    In these documents, you'll encounter the following:
    • The Entity Data Model
    • Entity SQL
    • LINQ to Entities
    • LINQ to DataSets
    • LINQ to SQL (formerly known as DLinq)
    Note: there is no preview release of the Entity Framework for the moment.
    We still don't know if DLinq will continue to live for a very long time (I don't see why we'd need two object-relational mapping solutions from Microsoft except for creating confusion).

    Update:
    These documents are also available online as web pages, not just Word documents.
    A document about the EDM (Entity Data Model) is also available: web page or Word document

    Cross-posted from http://linqinaction.net

  • Bye bye DLinq, Hello Linq for Sql and the ADO.NET Entity Framework!

    Some of you may have read the documents on ADO.NET 3.0 and the Entity Framework when they were published, before they were promptly removed. The big question since that time has been: What will happen to DLinq in regard to the future of ADO.NET, which seemed to offer the same services and more with a different solution?
    Well, Andres Aguiar has the scoop, live from TechEd in Boston: apparently both frameworks will be kept.

    OK, it actually happened. We'll have two mapping technologies in .NET v.next.

    LinQ for SQL, previously known as DLinQ is the 'simple' mapping technology.
    LinQ for Entities, will be on top of the new ADO.NET Entity Framework, and will be the 'complex' (we could say 'real') mapping technology.
    What? Two object-relational mapping technologies for .NET from Microsoft? What's the point?! Why not raise ObjectSpaces from the dead while the are at it...

    I feel the same as Andres:
    I think Microsoft did this for internal politically correctness (they did not want to not to ship any of the frameworks) but I can't see why this is good for the .NET Framework as a whole.
    The team that worked on DLinq worked on ObjectSpaces before and killing DLinq after ObjectSpaces may have been to hard for Microsoft's developers after all the years they have spent on these projects.

    To me, two solutions mean an excess of one. I don't see how people will be able to choose, and I think one will have to disappear sooner or later...

    Cross-posted from http://linqinaction.net

  • Bye bye WinFX, Hello .NET Framework 3.0!

    Somasegar, Corporate Vice President of Microsof's Developer Division, has announced that the WinFX brand has been killed! You should now talk about ".NET Framework 3.0" instead when you refer to the package that contains WPF (Windows Presentation Foundation - Avalon), WCF (Windows Communication Foundation - Indigo), WF (Workflow Foundation - Windows Workflow Foundation - Winoe), WCS (Windows CardSpace - InfoCard).
    The .NET Framework 3.0 runs on the .NET CLR 2.0.
    What will the framework delivered as part of the Orcas wave be called? .NET Framework 3.5? .NET Framework 4.0? And it will contain C# 3.0 and VB.NET 9.0...
    Clear as mud, isn't it? Microsoft's marketing likes to play funny games...

  • Copying and pasting text with styles removed - PureText

    I've been doing a lot of copy&paste operations between several Word documents or HTML pages lately, and I got fed up with doing "Edit | Paste Special... | Unformatted Text" all the time to avoid having my Word documents polluted with styles I don't want.
    A great little free tool came to the rescue: Steve Miller's PureText. I highly recommend that you give it a try!
    Pasting text with formatting and styles removed is as easy as using the Apple+V shortcut, an easy replacement for CTRL+V.

    Oh, for those who don't know, the Apple key is the one that looks like a window that looks like a waving flag located between CTRL and ALT...

  • Viewing the SQL generated by DLinq

    As demonstrated by Sahil in the last issue of his Demystifying DLinq series, you can get see the SQL DLinq would execute for a given query at debug-time using the built-in Query Visualizer:



    This useful little tool can also run the SQL query and show you the results if you want.

    In addition to the Query Visualizer, you can also get the SQL queries at runtime using the following line of code to redirect the SQL to the console: db.Log = Console.Out;
    Of course, you can also redirect the logs to anything else as far as it's a System.IO.TextWriter.

    Even better, you can also call GetQueryText(myQuery) on your DataContext instance to get the SQL at any time you want for a given query.
    If you have updated in-memory objects returned by DLinq, you can get the SQL that would be executed on the database by using DataContext.GetChangeText().

    A difference between GetQueryText() and GetChangeText() on one side, and the Query Visualizer on the other side, is that with the latter you can see the value of the SQL query's parameters.

    Cross-posted from http://linqinaction.net

  • Focusing on LINQ

    I've recently published some posts about LINQ, and as I wrote before, you can expect to see more on this weblog in the coming months. The reason? I'm currently writing a book on LINQ!
    I've opened a web site dedicated to the LINQ, XLINQ, DLINQ technologies and to the book. If you visit linqinaction.net you'll be able to find useful pointers to learn more about these technologies.

    Hopefully, the book and the site will give you everything you need to understand LINQ.

  • "Java succumbing to .NET in my organization", a Java developer

    A Java developer reports that the management of the group he works for inside a contractor company has decided to move from Java to .NET. The developer gives the reasons he sees behind this decision.
    I guess we could sum up what he writes like this: "Too much choice is bad". Probably not much you don't know already, but it's an interesting read. Is this a trend you've noticed?

    Of course choice is good, and I hate to see everyone wait for Microsoft to provide a solution to all their problems. But having too much options seems to be a problem, especially for managers who prefer not having to make choices...

    Read "Java Succumbing to .NET in my Organization"

    PS: of course, this doesn't mean that we don't have a lot of choice in .NET considering that we have close to 900 tools and libraries in the SharpToolbox!

  • Orcas release date, first estimates

    Roger Jennings has spotted very interesting information on Scott Guthrie's weblog. It's not like there is anything but excellent content on Scott's blog, but I haven't seen this kind of information elsewhere before.
    Scott has published a first post on using LINQ with ASP.NET projects a few days ago. Roger writes:

    Scott's LINQ with ASP.NET post provoked a large number of comments and replies, but the most interesting reply included this gem:
    We are looking to ship the second half of next year. We will start having full Orcas CTP drops (of all technologies) starting later this summer, and will also have a go-live license of Orcas before the final RTM date. So not too far off now when you can use the above techniques in production.
    This is the first Orcas RTM estimate and go-live committment directly from a Microsoft employee that I've encountered.

    If you browse the whole set of comments, you may spot other related information, which includes:
    • "We are making some changes to the CLR for that release, but are also being careful to keep a high runtime compat bar to ease deployments (the following release will then have more engine additions)."
    • "Orcas will be compatible with the 2.0 runtime. There will then be optional framework components you can install as well."
    This confirms that one of the design goals for LINQ is still to keep it compatible with .NET 2.0. What's new to me is that Microsoft is trying to keep the changes to the .NET runtime very light for the next release.

  • LINQ update: May 2006 CTP

    LINQ (including DLinq and XLinq) has just been udpated!
    There are many new features to discover. This update includes:

    • Productivity enhancements via DLINQ designer and debugger support within the Visual Studio 2005 IDE.
    • Support for a broader range of development scenarios thanks to new databinding and ASP.NET support.
    • Ability to integrate LINQ with existing code through features like LINQ over DataSet and DLINQ improvements including inheritance.
    • Feedback driven features including deep stored procedure support, since the earlier CTP.
    And much more!

    Get ready to see many posts about LINQ on this weblog. More on this soon...

    [Linq home page, Linq CTP download] (The download link seems to have problems but should be back soon)

  • Attach to Visual Studio's Development Web Server easily using a macro

    Something I have to do frequently is attaching to a running web application for debugging purposes. I don't always start my web applications in debug mode, but I often need to attach at some point when doing some testing.
    Unfortunately, there is no easy way to do this from Visual Studio. We have to attach to the server process "by hand". After some time doing this, you'll find it a bit boring...
    Here is a quick-n-dirty solution. It's a simple macro that attaches to the first web server process it finds. Just copy the code below to your macros using the Macro IDE (Tools | Macros | Macro IDE...).
    Once you have the macro, you can:

    • add a button to a toolbar by right-clicking on the toolbars, then "Customize... | Commands | Macros" and drag & drop the command on the toolbar of your choice
    • map a shortcut key to it using "Tools | Options | Environment | Keyboard" and search for the AttachToFirstDevWebServer
    Warning 1: this code attaches to the first server it finds, not necessarily the right one. Unfortunately, there is no way to find the correct web server as the processes do not provide information such as a port number or other useful information.
    Warning 2: the code searches for Visual Studio 2005's integrated Development Web Server. To attach to IIS instead (from VS 2003 for example), you'll have to adapt the code to attach to aspnet_wp.exe.

    ' This subroutine attaches to the first Development Web Server found.
    Public Sub AttachToFirstDevWebServer()
      Dim process As EnvDTE.Process

      For Each process In DTE.Debugger.LocalProcesses
        If (Path.GetFileName(process.Name).ToLower() = "webdev.webserver.exe") Then
          process.Attach()
          Exit Sub
        End If
      Next

      MsgBox("No ASP.NET Development Server found")
    End Sub

    Update: you may have to replace "webdev.webserver.exe" by "webdev.webserver2.exe"

  • MVP again in 2006

    I'm not the first of the April gang to announce my nomination as an MVP for one more year, but count me in for a third year.

  • New Atlas release with "go-live" license

    As announced on the Atlas weblog, you can now produce ASP.NET applications using Atlas since there is a "Go Live" license coming with the March CTP release of Atlas.
    You can get the new release and a lot of information directly from the Atlas web site.
    There is even a contest you can participate in to win prizes if you build an application using Atlas.

    "Atlas" is a set of technologies to add AJAX (Asynchronous JavaScript And XML) support to ASP.NET. It consists of a client-side script framework, server controls and more. Atlas is a free add-on to ASP.NET.

  • Windows Forms and WPF interoperability preview

    Those of you who are actively developing Windows Forms application may wonder what will happen when Avalon/WPF is ready. Will you have to rewrite your user interfaces completely in XAML? When and how will you have to migrate?

    Mike Henderlight from Microsoft gives you hints with his presentations about Crossbow, which is a piece of technology to build hybrid Windows Forms and WPF (Windows Presentation Foundation) applications.

    Crossbow is part of the WinFX SDK and will be included in the February CTP.

    [Via TSS.NET]

  • NDoc project stalled, no version for 2.0. What is Microsoft doing?

    NDoc is a very useful open source project that generates reference documentation from .NET assemblies and the XML documentation files generated by the C# compiler (or an add-on tool for VB.NET). NDoc generates documentation in several different formats, including the MSDN-style HTML Help format (.chm), the Visual Studio .NET Help format (HTML Help 2), and MSDN-online style web pages, which is much better than just the XML file we get from the compiler...

    Unfortunately, NDoc has not been ported to .NET 2.0 yet. There are some commercial tools available - not even sure they offer support for .NET 2.0 - but I think support for generating and integrating documentation should be built in Visual Studio. Josh Ledgard (lead program manager at Microsoft's developer division) writes about this problem, and asks how Microsoft could lend a hand to NDoc and other non-MS developer tools. This is an interesting question. Make sure to read the discussion in the comments.

    To get back to NDoc, if ever someone could help Jonas Lagerblad make progress...

    Update: Kevin Downs - main developer of NDoc 1.3 and the titular admin of the project - writes in a comment that he is working on NDoc 2.0 and has an alpha version available for testers.
    Update: NDoc 2 development stopped. Microsoft releases Sandcastle. 

  • Work with Visual Studio 2005, Build for .NET 1.1

    Via Larkware: Microsoft has released MSBee Beta 1.

    MSBee means MSBuild Everett Environment. Everett beeing the codename for .NET 1.1, MSBee is an extension for MSBuild that allows developers to build managed applications in Visual Studio 2005 that target .NET 1.1.
    A small limitation to know though: "
    At this time, we are not planning to add IDE support. Since MSBee will be a shared source release, the potential is there for the community to provide this support.".

    Update: Bruno Baia made the test, and yes, you can compile directly from VS 2005 if you add the following line after the existing import tag in a project file:
    <Import Project="$(MSBuildExtensionsPath)\MSBee\MSBuildExtras.FX1_1.CSharp.targets" />
    IntelliSense and help still present .NET 2.0 information, but this is not a big deal. I think the above statement about the missing IDE support is not clear at all.

  • How-To-Select Guides: Object-Relational Mapping Tools for .NET

    The lastest edition of the How-To-Select Guides for .NET developers has been published. This time the subject is object-relational mapping tools for .NET.
    This guide contains a brief discussion on object-relational mappers, lists decision points, authors and products, and provides a feature comparison table.
    I was interviewed for this guide and you can read my "informed opinion" in it.

    As a reminder, I have published an article that presents the criteria to consider when selecting an object-relational mapping product.

  • Code generation in Visual Studio: build providers, MSBuild tasks, custom tools

    PageMethods generates a list of your page methods in an XML file at compile time. This metadata file is then used to generate code you can invoke through the MyPageMethods namespace.
    The first version of PageMethods for Visual Studio 2005 supported the only web project model available at that time: the Web Site model. In this model, a custom build provider takes care of the XML file and generates .NET code.
    The latest version of PageMethods supports the Web Application project model as well. But a web application being a "class library" - and not strictly a "Web Site" in Visual Studio 2005 terms - build providers cannot be used in this case. Two solutions were possible: create an MSBuild custom task or a Visual Studio custom tool. I chose the latest, as it is easily integrated within Visual Studio and it works with Visual Studio 2002/2003 as well. In fact, custom tools are automatically used for XSD or WSDF files for example.

    If you want to learn more about this kind of features, I highly advise you to read Dino Esposito's article about custom build providers, custom MSBuild tasks,  and VS custom tools.

  • Borland to retire from the IDE market and focus on ALM

    I haven't used a Borland tool for quite a while, but it's always interesting to follow what is happening on their side. I knew Borland mostly for its developer tools. In the past, I've made extensive use of Turbo Pascal, Borland Pascal, Delphi and InterBase. Since then, Borland has published other tools like Kylix (Delphi for Linux), JBuilder, C#Builder or Delphi.NET. All IDE products.
    It's not knew at all that they had started getting into the Application Lifecycle Management market, but today come important news: Borland plans a separate company for its IDE products, which means they want to sell these product lines!

    You can read the official announcement by the CEO or a message from David Intersimone.

    It's true that during the last years, Borland had smaller and smaller market shares for IDEs and fewer resources allocated to them.
    The big question is: what will happen in the future for these products? Is this the end? Who will the buyer be, if any?

  • Holophony

    Put your headphones on and listen to this mp3...
    I haven't tried but apparently it also works with stereo speakers (not surround ones though).

  • Are you GSCP certified?

    These days a new programming paradigm is gaining momentum: GSCP.
    In fact, a lot of us already practice it even without knowing it. What does GSCP mean, will you ask... Simply Google Search, Copy/Paste!

  • URL rewriting breaks ASP.NET 2's themes

    If you try to use URL rewriting and ASP.NET 2 themes at the same time, you will likely get broken pages, because the two don't mix very well.
    A typical link to a theme's stylesheet looks like this in the generated HTML:
    <link href="App_Themes/Theme1/StyleSheet.css" type="text/css" rel="stylesheet" />
    The problem is that these links to CSS documents are using relative paths, which is not going to work fine if you use RewritePath on your web requests.

  • ASP.NET 2 weblogs

    I'm back to working on web applications and this time it is with ASP.NET 2 of course.
    To help you get started with the new ASP.NET version, here are some great weblogs you don't want to miss:

    Good places where you'll find a lot of tips as well as code samples, tutorials or the latest news about ASP.NET and Atlas.
    I probably missed some, but this is a good start. Any suggestion?