MSBuild Target Redirection (Alternative to install/uninstall Linq to VS)

Jomo (etc):

I'm guessing the same technique to get .NET 1.1 targets in VS2k5 would work for getting a Linq target   Am I missing anything tricky about how the preview compiler operates

Someone should make an app to automatically generate a new C#-like target definition for MSBuild, I suppose.  Feed it compiler and framework locations, and optionally where to store the new VS template...




Answer this question

MSBuild Target Redirection (Alternative to install/uninstall Linq to VS)

  • Tobias Manthey

    Hi Keith,
    That could absolutely work. I used the same technique to support .NET 1.1 (http://blogs.msdn.com/jomo_fisher/archive/2005/04/22/410903.aspx) as I did when I wrote the targets for the LINQ compiler. The prototype compiler is switch-compatible with the 2.0 compiler so this works nicely.

    You could imagine a single targets file that allows you to build C# 1.1, 2.0 and LINQ from a single project. Of course you'd have to use the lowest common denominator language features -or- rely on preprocessor directives to selectively build to the highest language level. Doing this would be pretty straight-forward.

    I heard you were nominated for MVP


  • vklrc

    See http://forums.microsoft.com/msdn/ShowPost.aspx PostID=121840.  It's a pretty good start, and points out an MSBuild conditional-import problem, it seems.

    The motivation for me would be to avoid installing/uninstalling Linq IDE support all the time.  In this way, I could keep most things 2.0-pure (for example, Real Work[tm]), except for those projects I wish to redirect to 3.0.  I guess intellisense is a bugbear in that regard.

    Perhaps packaging the preview as its own language would be better for this

    MVP: The only nomination I heard about was for Monad.  Still trying to figure that one out -- I'd only been active on the lists for a month or so (out of the whole history of the Monad lists).  Apparently they came to their senses, since the MVPs I *do* know about from this last cycle were, in fact, deserving long-timers.

    But it made a good start to a birthday trip to Reno.  They literally emailed to ask my interest just as I was shutting down the system.

  • Chumb

    bump

    Dinesh, Jomo, Matt, anyone



  • Taveira

    Hmm...

    I do like that, in general, though it may be more useful for retargetting frameworks, to deal with People Who Refuse To Upgrade, so that you can downgrade to broken logic, or use third-party bits.

  • nic667

    >> guess intellisense is a bugbear in that regard.

    Yeah, unfortunately its not so trivial to plug in a whole new intellisense package and have it be dialable per-project.

    Really, I think in a perfect world you do something like:

    #if TARGETTING_LINQ
      // You get 3.0 intellisense here.
    #endif
    # TARGETTING_1_1
     // You get 1.0 intellisense here.
    #endif
    // You get 2.0 intellisense here.

    Or something like this.




  • MSBuild Target Redirection (Alternative to install/uninstall Linq to VS)