none
Options for .NET 1.0 ref/usage of 3.5 assemblies RRS feed

  • Question

  • Can't add a reference from a legacy VS2002 1.0 app to a newly created 3.5 assembly. Get that "A reference to blah, blah DLL could not be added. This is not a valid assembly or COM component..." etc message. From what I've been reading out there, this either has to do with not being able to have to different versions of the .NET Framework running in the same AppDomain or simply a functional and/or structural difference in 3.5 assemblies that VS2002 simply cannot handle. With that in mind, what options are out there to work around this?

    1) Rewrite the legacy apps in VS2008/3.5. This would be very difficult to do within the time window we have to get a new system up and running. There are numerous apps that would need to get rewritten.

    2) Use old style web services (asmx) to commo? Write this in 3.5 using text encoding as opposed to binary SOAP/XML and then create web refs from the 1.0 app to this 3.5 web svc and have the 3.5 web svc then turn around and pass the calls back and forth with the 3.5 assembly(ies)? Sounds to me like this may be a performance hit in a heavy load scenario.

    3) Use WCF? Never used WCF, but I thought part of it allowed you to specify bindings so that disparate systems could talk to each other. Of course the issue here is that having never used WCF, the time frame constraint may come into play here as well so we might be better off just rewriting the 1.0 apps. Would this approach be similar to the asmx appraoch where this WCF component would essentially act as the gateway to back and forth commo between the 1.0 apps and the 3.5 assemblies, but just using a newer technology?

    4) I saw some folks in various groups/posts talk about using reflection during run time to do all the needed interaction thereby removing the need to do a design time hard reference to an assembly. So at runtime you would do an Assembly.LoadFile, and then do your various GetType, GetMethod, GetProperty, Invoke, etc calls as needed. This option also sounds like a performance hit in addition to being nasty to code up. To clean that up a bit, there were suggestions of having an interface to call the needed 3.5 assembly methods/properties, but honestly I am not sure how to do that or how it would look and work.

    5) Something else??

    Any suggestions/direction would be greatly appreciated.

    Wednesday, September 3, 2008 6:26 PM

Answers

  • The assembly file structure has changed in .NET 2.0.  .NET 1.x tools can't read them.  .NET 2+ tools have no problem with .NET 1.x assemblies.  Time for an upgrade.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Tuesday, September 9, 2008 9:02 AM
    Wednesday, September 3, 2008 11:21 PM
    Moderator

All replies

  • The assembly file structure has changed in .NET 2.0.  .NET 1.x tools can't read them.  .NET 2+ tools have no problem with .NET 1.x assemblies.  Time for an upgrade.
    Hans Passant.
    • Marked as answer by Zhi-Xin Ye Tuesday, September 9, 2008 9:02 AM
    Wednesday, September 3, 2008 11:21 PM
    Moderator
  •  .NET 2.0 also added generics at the IL level, and a .NET 1.x runtime wouldn't know what to do with such constructs.
    Thursday, September 4, 2008 6:51 AM