Dapper和MVC VNext中的问题

我为ASP.NET MVC VNext项目的测试创建了一个类库.

在这个类库中,我使用的是Dapper,所以我有了project.json:

{

  "dependencies": {
    "xunit": "2.1.0-beta2-*","xunit.runner.dnx": "2.1.0-beta2-*","Dapper": "1.42.0"
  },"commands": {
    "test": "xunit.runner.dnx"
  },"frameworks": {

    "dnx451": {
      "dependencies": {
        "Dapper": "1.42.0"
      }
    },"dnxcore50": {
      "dependencies": {
        "System.Collections": "4.0.10-beta-22816","System.Linq": "4.0.0-beta-22816","Microsoft.CSharp": "4.0.0-beta-22816","Dapper": "1.42.0"
      }
    }

  }
}

我一直收到错误

The type or namespace name 'Dapper' Could not be found (are you missing a using directive or an assembly reference?)    MvcProj.Test.DNX Core 5.0

我怎样才能解决这个问题?

解决方法

使用Dapper的测试版

由于dnxcore50仍然处于测试阶段,因此Dapper的发布版本都没有声明它的发布支持.这就是为什么Dapper家伙没有把它放在发布包中.

Dapper的beta版本中提供了DNX beta支持.尝试使用版本1.41.0-beta5,或者nuget feed中最新的非发行版本.

"dependencies": {
    //...
    "System.Data.sqlClient": "4.0.0-beta-23225","Dapper": "1.41.0-beta5"
},

我现在正在我的应用程序中使用它,它似乎运行良好.

相关文章

这篇文章主要讲解了“WPF如何实现带筛选功能的DataGrid”,文...
本篇内容介绍了“基于WPF如何实现3D画廊动画效果”的有关知识...
Some samples are below for ASP.Net web form controls:(fr...
问题描述: 对于未定义为 System.String 的列,唯一有效的值...
最近用到了CalendarExtender,结果不知道为什么发生了错位,...
ASP.NET 2.0 page lifecyle ASP.NET 2.0 event sequence cha...