在 .NET 1.1 中调用 .NET 2.0 程序集

发布于 2024-08-17 00:28:54 字数 327 浏览 6 评论 0原文

最近我在.NET 2.0版本中开发了一个内部框架,它基本上是类和助手。

问题是我有一些 .NET 1.1 站点和应用程序,并且想使用其中的框架。我知道我无法在.NET 1.1中调用.NET 2.0,但我有一个想法。

如果我使用 ComVisible 创建另一个 2.0 项目并引用一些 2.0 程序集,然后重新创建仅引用这些类的所需函数,并在 .NET 1.1 中调用这个新的 ComVisible 程序集;我可以在 .NET 1.1 中使用 2.0 程序集吗?

如果这基本上有效,我可以在.NET 1.1、Java Reflection 等中使用它。

或者我是在浪费时间吗?

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 applications 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟凡古楼 2024-08-24 00:28:54

我不明白你为什么要经历所有这些努力。只有两种可能性 - 要么:

  1. 运行这些站点/应用程序的服务器/工作站安装了 .NET Framework 2.0,在这种情况下,您不妨将这些站点/应用程序重新定位到 .NET 2.0 并重建/重新部署它们(这应该需要 10 分钟),或者

  2. 服务器/工作站没有安装 .NET Framework 2.0,在这种情况下,您所有的 COM 努力都是徒劳的,因为 2.0 程序集如果没有框架,它们本身将无法运行。

我最近将一大堆“旧版”2.0 应用程序重新定位到 3.5,如#1 所示,没有出现任何问题。我知道从 1.1 到 2.0 有极少数重大更改,但它们的数量太少了,几乎可以肯定,搜索这些更改所需的时间比处理所有 COM 疯狂问题所需的时间要少。

I don't see why you'd want to go through all of this effort. There are only two possibilities - either:

  1. 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

  2. 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文