• Centos升级安装.Net core 1.1


        VS2017已经发布了一个多月了,最期待的功能就是.net core的更新,终于去掉了繁琐了project.json的文件配置。我们尝试打开一个VS2015的.net core项目,会自动升级至.net core 1.1并去掉了project.json文件。

        这是一个好事情,感觉上和开发传统的项目更接近了一点。在对现有的项目进行了升级,自然而然就会要部署到服务器环境,但是当直接运行的话会出错

    很明显是提示.net core 的版本不对,要求我们升级服务器的.net core版本。原先部署.net core环境可以参考: 将ASP.NET Core应用程序部署至生产环境中(CentOS7)

     

    那么.net core 1.1要如何升级?

        我们打开微软官方的 .NET Core installation guide,发现安装方法和之前的一模一样:

    sudo yum install libunwind libicu
    curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=843449
    sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
    sudo ln -s /opt/dotnet/dotnet /usr/local/bin

    那么最直接的方法就是把最新的tar.gz文件下来了,然后覆盖安装在原来的/opt/dotnet下面,

    覆盖前:

     

    覆盖后:

    可以看到版本是升级了。

    这样升级之后对之前的1.0的应用有没有影响?

    而且在MSDN微软的这篇博客里 Announcing .NET Core 1.1有如下描述:

    Using .NET Core 1.1

    You can start by installing .NET Core 1.1. You can either install it globally using the .NET Core 1.1 installer or package manager for your operating system or try it an isolated (and easily removable) environment by downloading .NET Core as a zip.

    Safe side-by-side install

    You can safely globally install .NET Core 1.1 on a machine that already has .NET Core 1.0.

    The dotnet new command creates new templates that reference the latest runtime on the machine. This may not be desired. If not, you can hand-edit the versions in the resulting project.json to earlier version numbers. Based on feedback, we will be changing this behavior in the new version of the tools, at the same time we release the final version of Visual Studio 2017. If you do not use dotnet new to create new projects, but rely on Visual Studio, then you are not affected.

    明确说明.net core 1.1 不会影响原有的1.0的程序。为了验证(不做测试还是不敢上产线啊),我用原来的1.0的程序在1.1上面跑,实测完全没问题。

  • 相关阅读:
    Codeforces 615D Multipliers (数论)
    第十二届北航程序设计竞赛决赛网络同步赛 J题 两点之间
    ZSTU 4248 KI的目标(dfs)
    POJ2546 Circular Area(计算几何)
    HDU-ACM“菜鸟先飞”冬训系列赛——第7场 H
    Codeforces 761C Dasha and Password(枚举+贪心)
    Codeforces 761D Dasha and Very Difficult Problem(贪心)
    Datastructure
    GDB调试
    GCC操作
  • 原文地址:https://www.cnblogs.com/Hai--D/p/6728149.html
Copyright © 2020-2023  润新知