Mic*_*ers 15 unit-testing .net-4.0 .net-2.0 visual-studio-2012
我目前正在使用测试项目在Visual Studio 2012 RC中工作.我已经包含以下程序集:
这些程序集是在2.0.50727版本中构建的,我在.NET 4.0中有一个测试项目.因此,基于此信息,我已将app.config文件添加到项目中,其中包含以下行:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)
当我打算运行时,我会一直收到以下消息:
混合模式组件被构建针对运行时的版本"V2.0.50727",并且不能在没有额外的配置信息的4.0运行时加载.
这是否是Visual Studio 2012 RC测试项目中的一个错误,它忽略了app.config文件或者我做错了什么?
有关其他信息,我还包括我的测试代码:
var connectionString = new SqlConnectionStringBuilder()
{
DataSource = @"(local)",
IntegratedSecurity = true
}.ConnectionString;
var sql = "alter database [Test] set single_user with rollback immediate go ";
sql += "drop database [Test] go ";
sql += "create database [Test] go ";
sql += Properties.Resources.Test;
var connection = new SqlConnection(connectionString);
var server = new Server(new ServerConnection(connection));
server.ConnectionContext.ExecuteNonQuery(sql);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3523 次 |
| 最近记录: |