从 .Net3.5 解决方案引用 .Net2.0 项目,无需升级项目文件 [csproj]
我有一个有趣的问题。
我正在开发.Net2.0 解决方案。我已经完成了我的开发并检查了我的源代码[呃,到本地 Clearcase 流 - 不要问,这只是意味着我已经完成了开发]。该源是并且必须保持 .Net2.0 Vs2005 兼容。
单元测试稍微宽松一些。我想利用.Net3.5 的 lamda 表达式和全方位的 Moq 模拟功能。为此,我在 Vs2008 中创建了一个单独的解决方案,并尝试引用 Vs2005 项目 - 但存在问题。
引用源项目需要将项目升级到Vs2008,这破坏了我们的构建解决方案[必须保留.Net2.0 Vs2005]。我还考虑过创建一个并行项目,但这有几个缺点 - 包括同步和源代码控制问题。
理想情况下,我想按原样引用 Vs2008 中的 Vs2005 项目。
有想法吗?建议?解决方案?反驳? :)
谢谢!
PS 在提交之前尝试搜索 SO,但如果您碰巧知道这是一个骗局,重定向将不胜感激!干杯!
I have an interesting problem.
I am developing for a .Net2.0 solution. I have finished my development and checked my source in [er, to a local Clearcase stream - don't ask, this just means I'm done dev]. This source is, and must remain .Net2.0 Vs2005 compliant.
Unit testing is somewhat more lax. I would like to take advantage of .Net3.5's lamda expressions and full range of Moq's mocking capabilities. To this end, I have created a separate solution in Vs2008 and attempted to reference the Vs2005 project - however there are problems.
Referencing the source project requires upgrading the project to Vs2008, breaking our build solution [which must remain .Net2.0 Vs2005]. I have also considered creating a parallel project but this has several drawbacks - including synchronization and source control issues.
Ideally, I would like to reference the Vs2005 project from Vs2008 as is.
Ideas? Suggestions? Solutions? Disproof? :)
Thanks!
Ps attempted a search of SO prior to submission, but if you happen to know this is a dupe, redirection would be much appreciated! Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您无法引用该项目,因此您必须直接引用程序集。添加对测试解决方案的引用时,只需单击“浏览”选项卡并找到vs2005项目创建的.dll即可。
Since you can't reference the project you will have to reference the assembly directly. When adding the reference to the test solution, just click on the "Browse" tab and find the .dll that the vs2005 project created.
您可以在同一文件夹中为 VS2008 创建一个单独的项目,并在其中包含相同的文件。 VS2008 仍然允许您生成 v2 程序集,尽管您会引入保持 VS2005 和 VS2008 项目同步的问题。
You could create a separate project for VS2008 in the same folder, and include the same files in it. VS2008 will still allow you to generate v2 assemblies, although you will introduce issues keeping the VS2005 and VS2008 projects in sync.