尝试在Linux上编译KestrelHttpServer

发表于:2015-7-31 10:10

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:dudu    来源:51Testing软件测试网采编

  Kestrel是目前在非Windows平台上运行ASP.NET 5应用程序的唯一可用Web服务器,但微软似乎将它冷落在一边,源代码更新很慢。
  今天试着在Linux上编译Kestrel的源代码,遇到了很多问题。在这篇博文中记录一下。
  运行编译命令:
  ./build.sh
  出错信息:
  -bash: ./build.sh: Permission denied
  修复方法:
  chmod +x build.sh
  再次编译,出错:
  ./build.sh: line 31: packages/KoreBuild/build/kvm.sh: No such file or directory
  ./build.sh: line 35: kvm: command not found
  修复方法:在build.sh中删除以下的代码:
  if ! type k > /dev/null 2>&1; then
  source packages/KoreBuild/build/kvm.sh
  fi
  if ! type k > /dev/null 2>&1; then
  kvm upgrade
  fi
  继续编译,出错:
  Unable to locate xunit.runner.kre >= 1.0.0-*
  Writing lock file /data/git/KestrelHttpServer/test/Microsoft.AspNet.Server.KestrelTests/project.lock.json
  Restore complete, 192ms elapsed
  Total time 1067ms
  Errors in /data/git/KestrelHttpServer/test/Microsoft.AspNet.Server.KestrelTests/project.json
  Unable to locate xunit.runner.kre >= 1.0.0-*
  修复方法:将 test/Microsoft.AspNet.Server.KestrelTests/project.json 文件中的 kre 改为 aspnet,vim 命令如下:
  :%s/kre/aspnet/g
  继续编译,出现错误:
  /data/git/KestrelHttpServer/src/Kestrel/ServerFactory.cs(1,24): error CS0234: The type or namespace name 'Hosting' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
  ...
  修复方法:修改 src/Kestrel/project.json 中的 frameworks 部分,修改为:
  "frameworks": {
  "dnx451": { },
  "dnxcore50": { }
  }
  继续编译,出现新的错误:
  src/Kestrel/ServerFactory.cs(4,27): error CS0234: The type or namespace name 'ConfigurationModel' does not exist in the namespace 'Microsoft.Framework' (are you missing an assembly reference?)
  修复方法:在 src/Kestrel/project.json 中添加 Microsoft.Framework.ConfigurationModel 的引用
  {
  "dependencies": {
  "Microsoft.Framework.ConfigurationModel": "1.0.0-*"
  }
  }
  继续编译,出现新的错误:
  src/Kestrel/ServerRequest.cs(1,24): error CS0234: The type or namespace name 'HttpFeature' does not exist in the namespace 'Microsoft.AspNet' (are you missing an assembly reference?)
  修复方法:在 src/Kestrel/project.json 中添加 Microsoft.AspNet.HttpFeature 的引用
  "Microsoft.AspNet.HttpFeature": "1.0.0-*"
  但该修复方法无效,依然出现同样的错误。。。就卡在这,没找到解决方法。
  于是,这次编译尝试 Kestrel 失败。
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号