1
我在Visual Studio中設置了一個Azure服務結構項目,並創建了一個ASP .net核心服務。我現在需要引用一個類庫,但無論我嘗試什麼,我都會得到一個'依賴無法解決的錯誤'。這裏是我的.NET的核心project.json:.net核心服務結構項目的引用類庫
{
"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核心類庫。我在這裏錯過了什麼?
你使用的是dotnet核心RC2嗎?這是必需的: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-add-a-web-frontend/ – LoekD
與x64有什麼關係? –
我們決定暫時不與.net Core一起使用。如果我有機會,我會創建一個新項目,看看編譯類庫是否有幫助(我不記得是否我第一次做到這一點)。 –