来自.net核心服务结构项目的引用类库

时间:2016-07-22 09:00:22

标签: .net visual-studio-2015 azure-service-fabric

我在Visual Studio中设置了一个Azure服务结构项目,并创建了一个ASP .net核心服务。我现在需要引用一个类库,但无论我尝试什么,我得到一个'依赖无法解决错误'。这是我的.net核心project.json:

{
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Razor.Tools": {
  "version": "1.0.0-preview2-final",
  "type": "build"
},
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.ServiceFabric": "5.1.163",
"Microsoft.ServiceFabric.Data": "2.1.163",
"Microsoft.ServiceFabric.Services": "2.1.163",
"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},

"tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
},

"frameworks": {
"net46": {
  "dependencies": {
    "ClassLibrary3": {
      "target": "project" }
  }
} 
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"publishOptions": {
"include": [
  "wwwroot",
  "Views",
  "Areas/**/Views",
  "appsettings.json",
  "web.config"
 ]
},

"scripts": {
}
}

这是类库的project.json:

{
  "version": "1.0.0-*",

  "dependencies": {
},

"frameworks": {
  "net46": {} 
 }
}

类库是.net核心类库。我在这里缺少什么?

1 个答案:

答案 0 :(得分:0)

确保.NET类库设置为显式构建到x64而不是AnyCPU。