尝试创建我的Docker容器。图像构建没有问题但是当我尝试运行时:
docker run -t -d --name website website
我得到以下异常:
System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'Asp.Net,Version=v5.0':
app 1.0.0
Microsoft.Framework.Logging.Interfaces 1.0.0-beta2
Searched Locations:
/{name}/project.json
/root/.kpm/packages/{name}/{version}/{name}.nuspec
/usr/lib/mono/4.5/{name}.dll
/usr/lib/mono/4.5/Facades/{name}.dll
Try running 'kpm restore'.
at Microsoft.Framework.Runtime.DefaultHost.GetEntryPoint (System.String applicationName) [0x00000] in <filename unknown>:0
at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
看起来像一个缺少的引用,但在project.json中肯定会引用它,因为我包括Microsoft.AspNet.Hosting。
它建议运行kpm恢复,但我不能这样做,因为容器没有运行。
之前有人见过类似的东西吗?
更新#1
好的,如果我添加一个显式引用Microsoft.Framework.Logging.Interfaces解决但我仍然留下app 1.0.0,我不知道
更新#2
这是我的project.json:
{
"webroot": "wwwroot",
"dependencies": {
"Kestrel": "1.0.0-beta1",
"Microsoft.AspNet.Diagnostics": "1.0.0-beta1",
"Microsoft.AspNet.Hosting": "1.0.0-beta1",
"Microsoft.AspNet.Mvc": "6.0.0-beta1",
"Microsoft.AspNet.Server.WebListener": "1.0.0-beta1",
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0.0-beta1",
"System.Net.Http": "4.0.0-beta-22231"
},
"commands": {
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5001",
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --server.urls http://localhost:5004"
},
"frameworks": {
"aspnetcore50": {
}
}
}
答案 0 :(得分:3)
我认为问题在于您尝试在CoreCLR(aspnetcore50
)上运行。
由于您在Linux / Mono上运行,因此您应该定位DesktopCLR(aspnet50
)。