Re: Detecting If A Namespace Is Available

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Wed, 04 Feb 2009 04:58:05 -0800, Justin R. <JRusbatch@xxxxxxxxx> wrote:

Is it possible to structure a program in a way that it could, for
instance, utilize LINQ if .NET 3.5 is installed, but not if the client
only has .NET 2.0?

It should be. Not that I've actually tried it myself though.

What I would do: configure the project to target 2.0. Write wrappers for the .NET 3.5 features I want to use. On initialization, attempt to load the .NET assemblies where those features are located, and if successful, use Reflection to obtain references to the appropriate class members, which then can be used to delegate the features advertised by your wrappers. For static members, you can do this right away. For instance members, you'll do it when an instance of your wrapper class is created.

All that said, while this technique would be useful for certain kinds of things, it seems to me that for most things it's not. After all, if you want to support .NET 2.0, you have to have an alternative implementation and frankly, if that implementation is good enough for .NET 2.0 users, it should be good enough for everyone. And while there may be some addition maintenance issues for situations where you have to essentially reinvent the wheel, it seems to me those maintenance issues are less of a problem than trying to maintain code that does the above.

Pete
.



Relevant Pages

  • ANN: MM Code Explorer 4.05 released - new navigation features
    ... Multiple files spanning Navigation History: ... And of course there are tons of other features included: ... As a Browser it improves navigation by showing classes and members ... ModelMaker Tools ...
    (borland.public.delphi.thirdpartytools.general)
  • ***RACEXPERT NEWS***
    ... Our Affiliate Scheme has certainly caught the eye of a great many members - ... Subscribers are part of a "RaceXpert Community" which offers 'Private ... We regularly give our members BIG-PRICED WINNERS ... RaceXpert - more features, more savings, more profit. ...
    (uk.sport.horseracing)
  • Re: Free Money - 100% Guaranteed
    ... Our Affiliate Scheme has certainly caught the eye of a great many members - ... Subscribers are part of a "RaceXpert Community" which offers 'Private ... We regularly give our members BIG-PRICED WINNERS ... RaceXpert - more features, more savings, more profit. ...
    (uk.sport.horseracing)
  • IJDb funky new features
    ... complete overhaul - adding features such as a profile page which details ... For an example, see my profile page: ... You can now alse see a list of all IJDb members who plan to attend an ...
    (rec.juggling)
  • Extension methods almost allow multiple inheritance via mixins (but not quite)
    ... When I first heard about these new features, I was very excited as it ... multiple inheritance almost painless in C#. ... getter and setter private, there'd be no need for a property at all!). ... +wrappers. ...
    (microsoft.public.dotnet.languages.csharp)