在同一项目中使用亚音速 2.x 和 3.x
可以将它们混合吗?我这么问是因为我有一个大项目使用 Subsonic 2.x 生成的类(在编译的 dll 中),但想开始使用 3.x 来处理新东西。
我昨晚在一个项目中进行了尝试,其中我引用了 subsonic.dll 和 subsonic.core.dll,但这不适用于不明确的引用等。因此删除了 2.x,然后我的旧编译的 subsonic 出现了问题生成的类需要 Subsonic 2.1 才能运行。
Is it possible to mix them? I'm asking because I have a big project that uses Subsonic 2.x generated classes (in a compiled dll) but would like to start using 3.x for new stuff.
I tried it last night with a project where I had references to both subsonic.dll and subsonic.core.dll but that didn't work with ambiguous references, etc. So removed 2.x and then got an issue with my older compiled subsonic generated classes in that they needed Subsonic 2.1 to run.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
嗯...我认为您能够做到这一点的可能性很小,但是您需要对大量代码使用完整的限定类名(namespace.class),因为可能存在命名冲突。这并不容易做到,而且绝对不推荐。 (这甚至可能无法完成。)
如果不进行大量重新编码,就无法从 2.x 迁移到 3.x。我在 2.2 中有很多大项目,在尝试更新到 3.0 后,我遇到了一些问题,所以我决定将它们保留在 2.2 中。我很想升级到 3.0 并使用新的东西,但我没有时间(现在)重新编码 2.x 和 3.0 之间更改的东西。
我建议更新到 2.2。 2.1 和 2.2 之间不应该存在任何向后兼容性问题。我只需更改我的参考即可更新到 2.2。
只是好奇,您使用的是 ActiveRecord 还是 Repo 实现?
您只有 2 个选择:
Hmm... I think there's a small chance that you might be able to do this, but you'd need to use the full qualifying class names (namespace.class) for a lot of code because there might be naming conflicts. It wouldn't be easy to do and definitely not recommended. (It might not can even be done.)
You can't move from 2.x to 3.x without doing a lot of recoding. I have a bunch of big projects in 2.2 and after trying to update to 3.0, I ran into some issues so I've decided to keep them in 2.2. I'd love to upgrade to 3.0 and use the new stuff, too, but I don't have the time (right now) to recode the stuff that changed between 2.x and 3.0.
I do recommend updating to 2.2. There shouldn't be any backwards compatibility issues between 2.1 and 2.2. I was able to update to 2.2 by just changing out my reference.
Just curious, are you using ActiveRecord or Repo implementation?
You only have 2 options:
我想我应该在这里跟进并让人们知道我能够让它发挥作用。我选择做的是编辑 Subsonic 2 源代码并将其放入 Subsonic2 命名空间(所有内容),重新编译为 subsonic2.dll 等。必须稍微修改 web.config,然后修改我的旧代码以引用subsonic2 等。
我现在能够在同一个项目中混合 Subsonic 2 和 3。
格里
Thought I'd follow up here and let people know that I was able to get this to work. What i chose to do was to edit the Subsonic 2 source code and put it into a Subsonic2 namespace (everything), recompile to subsonic2.dll, etc. Had to modify the web.config slightly, then went and modified my old code to reference subsonic2, etc.
Am now able to mix both Subsonic 2 and 3 in the same project.
Gerry
吉姆——我正在使用 ActiveRecord。 2.x 位于一个命名空间中,3.x 位于另一个命名空间中。不过,我想问题是 2.x 是否可以编译为与 3.x 运行时一起运行。
谢谢,
格里
Jim--I'm using ActiveRecord. The 2.x is in one namespace and 3.x would be in another. However, I guess the question is whether the 2.x can be compiled to run with the 3.x runtime.
Thanks,
Gerry