dotnet Core 2.0学习笔记(一)

一:Dotnet Core Windows运行环境,标红部分要注意

https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites?tabs=netcore2x

.NET Core supported Windows versions

.NET Core is supported on the following versions of :

  • Windows 7 SP1
  • Windows 8.1
  • Windows 10, Windows 10 Anniversary Update (version 1607) or later versions
  • Windows Server 2008 R2 SP1 (Full Server or Server Core)
  • Windows Server 2012 SP1 (Full Server or Server Core)
  • Windows Server 2012 R2 (Full Server or Server Core)
  • Windows Server 2016 (Full Server, Server Core, or Nano Server)

See .NET Core 2.x - Supported OS Versions for the complete list of .NET Core 2.x supported operating systems.

See .NET Core 1.x Supported OS Versions for the complete list of .NET Core 1.x supported operating systems.

.NET Core dependencies

.NET Core 1.1 and earlier requires the Visual C++ Redistributable when running on Windows versions earlier than Windows 10 and Windows Server 2016. This dependency is automatically installed by the .NET Core installer.

Microsoft Visual C++ 2015 Redistributable Update 3 must be manually installed when:

  • Installing .NET Core with the installer script.
  • Deploying a self-contained .NET Core application.

Note

For Windows 7 and Windows Server 2008 machines only:
Make sure that your Windows installation is up-to-date and includes hotfix KB2533623 installed through Windows Update.

 

二:Dotnet Core程序发布

应用程序的发布,大概可以理解为两种情况,一种是依赖运行时的发布,另一种是不依赖全局.net core运行环境,“Self-contained”,即把所有依赖打包到一起的方式。

第一种方式比较普遍,发布到用户环境时,先安装.net core 的runtime,再把应用程序复制到客户机,即完成部署。

第二种方式特殊一点,需要在发布时,将所依赖的运行环境,一起打包到发布目录中。按照官方说明,修改csproj 项目文件,指定目标环境的Runtime Identifier (RID) ,如下:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeIdentifiers>win7-x64;osx.10.11-x64</RuntimeIdentifiers>
</PropertyGroup>
</Project>

然后可以在.net core CLI中或者Vs中,进行项目的发布。

我的发布目标为Windows server 2008 R2,对应RID为win7-x64,发布后的目录:RtuServer\bin\Release\Win2008R2,运行RtuServer.exe成功。

 

转载于:https://www.cnblogs.com/zhaiyf/p/7904151.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值