.NET 1.1 Issues Continue

Frans Bourma comments on the issues he has with VS.NET 2003, and even goes as far to say that if you are an ISV, you should not be building tools to .NET 1.1. Wow. That's a pretty rough statement. Well, I'm an ISV and I upgraded to VS.NET 2003 six months ago, and while it means that you have to exert a little more effort, the improvements alone are worth it.

My GenX.NET component requires the Oracle ADO.NET Data Provider to build spreadsheets against Oracle databases. Now, with .NET 1.0, it's an add-on that has to be installed, and the namespace it references is Microsoft.Data.Oracle. Now, in .NET 1.1, the Oracle provider is included, and it's now a part of the System.Data Namespace (System.Data.OracleClient). Now, for obvious reasons, you can't run the 1.0 assembly on 1.1, so you have to have 2 codebases, with code optimizations geared to each version.

If you're building an executable or a web app, you can use the "Project Properties" > "Build" page to specify if you want to add policy redirect tage to the .config files.

Now, I came up with some really special code for you all, that I'm going to talk about further here. If you put this code in your constructor, you'll be able to have your class file redirect to 1.0 programmatically. Now, this hasn't been tested since I don't have a system configured properly to test it on (yes, yes I know VMWare, my laptop harddrive is too small) Please give me some feedback so that I can adjust it accordingly.

NOTE: CORRECTED

Public Sub New()
    
If System.Environment.Version.Minor = "0" Then
         
Dim runtime As System.Reflection.Assembly
         
Dim framework() As AssemblyName = runtime.GetReferencedAssemblies
  
          Try
              
For i As Integer = 0 To framework.Length
                    runtime.Load((framework(i).Name & ", Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"))
               
Next i
         
Catch ex As Exception
               'Error handling goes here

          End Try
    
End If
End Sub

I really hope that works. Intellectually it makes sense anyways.

2 Comments




  • This line looks like a bug waiting to happen:





    If System.Environment.Version.Minor = "0" Then





    What happens when this code is run on version 2.0 of the Framework?


  • This code assumes that it REALLY wouldn't run on 2.0 because of the changes to the configuration system, et. al. Besides, the code does not run anyways, although it was a nice idea, I'm still missing a piece to the puzzle.

Comments have been disabled for this content.