Recently I developed a internal framework in .NET 2.0 version, which is basically classes and helpers.
The problem is I have some .NET 1.1 sites and a开发者_C百科pplications and would like to use my framework from them. I know that I can't call .NET 2.0 in .NET 1.1, but I have an idea.
If I create another 2.0 project with ComVisible and reference some of my 2.0 assemblies, then recreate my needed functions only referencing these classes, and in .NET 1.1 call this new ComVisible assembly; could I then use 2.0 assemblies in .NET 1.1?
If this works basically I can use it in .NET 1.1, Java Reflection, etc.
Or am I wasting my time?
I don't see why you'd want to go through all of this effort. There are only two possibilities - either:
The servers/workstations running those sites/applications have the .NET Framework 2.0 installed, in which case you might as well just re-target those sites/applications to .NET 2.0 and rebuild/redeploy them (which should take all of 10 minutes), or
The servers/workstations do not have the .NET Framework 2.0 installed, in which case all your COM effort is for naught because the 2.0 assemblies themselves won't be able to run without the Framework.
I recently re-targeted a whole bunch of "legacy" 2.0 apps to 3.5 as in #1 without a single problem. I know that there were a tiny handful of breaking changes from 1.1 to 2.0, but they are so few in number that it would almost certainly take less time to search for those than it would take to deal with all that COM craziness.
精彩评论