• 源码编译


    参考:

    自己Build并Debug ASP.NET Core源代码 - 知乎

    直接调式源码:调试ASP.NET Core 2.0 源代码 - Sweet-Tang - 博客园

    win8.1更改长路径: 如何解决win8.1中文版没有组策略的问题(珍藏版)_百度经验

    主站的aspnetcore /` BuildFromSource.md·dotnet / aspnetcore·GitHub

    为什么要源码编译

    源码编译作用:

    • 要添加或者修改框架的功能时,修改框架源码且编译后就能实现,不过一般没必要
    • 可以调式框架源码,方便学习调式框架

    源码编译过程

    ## .NET Core 源码编译

    https://github.com/dotnet

    git clone https://github.com/dotnet/runtime.git

    ### Windows环境:

    Win 10 专业版 1903

    **长路径:**

    `组策略(gpedit.msc) > 计算机配置 > 管理模板 > 系统 > 文件系统 > 启用 Win32 长路径`

    管理员终端:git config --system core.longpaths true

    **VS 安装组件**

    1. 工作负载: .NET桌面开发、 C++桌面开发

    2. 使用.vsconfig

    CMake(最低3.15.5)http://www.cmake.org/download

    Python (最低3.7.4)

    ### Linux环境

    按以下命令顺序执行:

    ```shell
    # 1. 安装以下软件包
    sudo apt-get update
    sudo apt-get install apt-transport-https ca-certificates gnupg software-properties-common wget

    # 2. 获取签名密钥
    wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -

    # 3. 将kitware存储库添加到源列表并进行更新。
    sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/bionic main'
    sudo apt-get update

    # 4. 安装 kitware 密钥更新包
    sudo apt-get install kitware-archive-keyring
    sudo apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA

    # 5. 安装所有的依赖包
    sudo apt-get install locales cmake llvm-9 clang-9 autoconf automake libtool build-essential python curl git lldb-6.0 liblldb-6.0-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libssl-dev libnuma-dev libkrb5-dev

    # 编译项目
    ./build.sh -subsetCategory CoreClr
    ./build.sh -subsetCategory Libraries
    ./build.sh -subsetCategory Installers

    # 安装运行时,注意目录问题
    tar zxf /home/runtime/artifacts/packages/Debug/Shipping/dotnet-runtime-5.0.0-dev-linux-x64.tar.gz -C /usr/share/dotnet
    ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet
    ```

    dev 运行时安装包的路径:runtime/artifacts/packages/Debug/Shipping

    使用开发版运行时调试的项目配置(csproj)

    ```xml
    <Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp5.0</TargetFramework>
    <!--添加下面两行-->
    <UseAppHost>false</UseAppHost>
    <RuntimeFrameworkVersion>5.0.0-dev</RuntimeFrameworkVersion>
    </PropertyGroup>

    </Project>

    ```

    Linux 5.0预览版 SDK安装:

    ```shell
    # 创建安装目录
    mkdir /home/dotnet_install
    # 转到安装目录
    cd /home/dotnet_install
    # 下载安装脚本,我们这里是从微软官方下载的5.0预览版
    curl -L https://aka.ms/install-dotnet-preview -o install-dotnet-preview.sh
    # 执行脚本进行安装
    bash ./install-dotnet-preview.sh
    ```

    **附部分安装资源:**

    5.0 开发版运行时:

    dotnet-apphost-pack-5.0.0-dev-win-x64.exe

    dotnet-runtime-5.0.0-dev-win-x64.msi

    5.0 开发版符号表:

    dotnet-runtime-symbols-5.0.0-dev-win-x64.zip

    最新版CMake for win:

    cmake-3.17.0-win64-x64

    如有错误,欢迎您指出。
    本文版权归作者和博客园共有,欢迎转载,但必须在文章页面给出原文链接,否则保留追究法律责任的权利。
  • 相关阅读:
    网络数据包分析工具列表
    完美支持Py3的微信开发库推荐
    微信后台服务器地址验证的逻辑
    人工智能头条技能树图谱汇集
    如何构建通用 api 中间层
    vue 2.0 购物车小球抛物线
    基于Vue的事件响应式进度条组件
    vuex学习总结
    vue 上传图片到阿里云(前端直传:不推荐)
    vue-router的history模式发布配置
  • 原文地址:https://www.cnblogs.com/qingyunye/p/12707362.html
Copyright © 2020-2023  润新知