Project.json引用SQLite

时间:2016-03-29 12:38:58

标签: c# sqlite nhibernate asp.net-mvc-5 dnx

我想将其中一个单元测试项目转换为使用项目文件的json格式。单元测试使用NHibernateSQLite来执行。 Project.json文件看起来像这样,

{
  "version": "1.0.0-*",
  "compilationOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "System.Data.SQLite.Core": "1.0.99",
    "NUnit": "3.2.0",
    "NUnitLite": "3.2.0",
    "NSubstitute": "1.9.2"
  },

  "runtimes": {
    "win": { },
    "win-anycpu": {
      "#import": [ "win" ]
    }
  },

  "commands": {
    "test": "Infrastructure.Test"
  },

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "Domain": "1.0.0-*",
        "Infrastructure": "1.0.0-*"
      }
    }
  },

  "exclude": [
  ],
  "publishExclude": [
    "**.user",
    "**.vspscc"
  ],
  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
  }
}

问题是,当我尝试运行它时,我得到异常说Unable to load DLL 'SQLite.Interop.dll':我认为这是因为包中附带了上述文件的2个不同的x86和x64二进制文件,它们位于build文件夹。

我如何让这个工作?可以找到完整的来源here

1 个答案:

答案 0 :(得分:0)

在程序包管理器控制台中运行它

PM> Update-Package -reinstall System.Data.SQLite.Core

有关详细信息,请参阅此link