zoukankan      html  css  js  c++  java
  • 尝试在Linux上编译KestrelHttpServer

    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 失败。

  • 相关阅读:
    JS实现倒计时
    jQuery图片展示插件Galleria
    几个常用的方法
    整理了一个多数据库通用操作类
    Oracle 伪列、取前几条记录、日期判断等
    第十九章 10头节点类,中间节点类和尾节点类 简单
    第十八章 38总结 简单
    第十九章 代码重用 6按别名传递book对像 简单
    第十九章 代码重用 3类书类 简单
    第十九章 代码重用 4为图书重载GetAuthor函数 简单
  • 原文地址:https://www.cnblogs.com/dudu/p/4610074.html
Copyright © 2011-2022 走看看