多大测试.NET 3.5组件使用.NET 4.0测试组件时,是风险 [英] How big is the risk when testing a .net 3.5 Assembly using a .net 4.0 test assembly

查看:155
本文介绍了多大测试.NET 3.5组件使用.NET 4.0测试组件时,是风险的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道的Visual Studio 2010 SP1允许试验项目现在的目标3.5。 然而,由于种种原因我不完全AP preciate,我们的测试项目仍瞄准点网4.0。

I realise that Visual Studio 2010 sp1 allows test projects to target 3.5 now. However, for various reasons I don't fully appreciate, our test projects still target dot net 4.0.

一般的问题是在标题。有多大的风险?

The general question is in the title. How big is the risk?

具体做法是presumably意味着该测试将在CLR v4的运行,而我们的许多客户将使用CLR V2。 此外,测试似乎使用库组件的v4的(如System.Data这),即使应用程序建立对v2的

Specifically, this presumably means that the tests will run in the CLR v4, whereas many of our clients will be using CLR v2. Also, the tests seem to use v4 of library components (such as System.Data), even though the application is built against v2.

一种方法(System.Data.SqlClient.SqlBulkCopy)含有2版已定格在第4版中的错误。我们的测试错过了。

One method (System.Data.SqlClient.SqlBulkCopy) contains a bug in v2 which has been fixed in v4. Our testing missed this.

撇开CLR,我怎么能强迫我的应用程序使用的一些库V2,即使它是由(加载到的应用程序域)一个V4测试组件引用?我一直在尝试用一个例子,并且似乎无法做到这一点。我的3.5应用程序引用System.Data这v2和回声的程序集版本号到控制台。当从3.5测试组件调用,版本为2.0。从4.0测试组件,版本为4.0。 (特定版本设置为true,从我的应用程序参考)

Leaving aside the CLR, how can I force my application to use v2 of some library, even when it is referenced by (loaded into the app domain of) a v4 test assembly? I've been experimenting with an example, and can't seem to make it happen. My 3.5 App references System.Data v2, and echos the assembly version number to the console. When called from a 3.5 test assembly, the version is 2.0. From a 4.0 test assembly, the version is 4.0. ("Specific Version" is set to true in the reference from my App)

推荐答案

我没有一个答案,所以我们已经决定恢复我们的测试项目,DOTNET 3.5侧步的问题。这意味着根据在CLR 2.0运行测试。但是,我们仍然使用MSTest的从VS2010,并且仍然能够使用漂亮的2010的功能,如测试类别和数据驱动的测试。

I don't have an answer to this, so we've decided to side-step the issue by reverting our test projects to dotnet 3.5. This means that tests run under the CLR 2.0. However, we still use MSTest from VS2010, and are still able to use nifty 2010 features such as test categories and data driven tests.

这篇关于多大测试.NET 3.5组件使用.NET 4.0测试组件时,是风险的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆