电子商务网站开发语言占比,中国软件外包网,wordpress 进度插件,html5企业网站一、编译环境
首先#xff0c;不管是Windows还是Linux版本CoreCLR的编译#xff0c;都是在Windows10上进行的。 二、CoreCLR for Windows
在Windows上做编译怎么能少得了Visual Studio,由于Visual Studio 2017刚刚发布#xff0c;所以选用Visual Studio 2017版本作为编译工…一、编译环境
首先不管是Windows还是Linux版本CoreCLR的编译都是在Windows10上进行的。 二、CoreCLR for Windows
在Windows上做编译怎么能少得了Visual Studio,由于Visual Studio 2017刚刚发布所以选用Visual Studio 2017版本作为编译工具。
编译组件
Visual Studio 2017安装组件
.NET Desktop Development
All Required Components.NET Framework 4-4.6 Development Tools
Desktop Development with C
All Required ComponentsVC 2017 v141 Toolset (x86, x64)Windows 8.1 SDK and UCRT SDKVC 2015.3 v140 Toolset (x86, x64)
还有一个比较重要的问题就是使用VS2017的话还需要注册一个Visual Studio 2015的组件需要运行如下命令regsvr32.exe %VSINSTALLDIR%\Common7\IDE\msdia120.dll 因为需要VS2017的环境变量当然这也需要在Developer Command Prompt for VS2017 中运行。 还有最重要一点Visual Studio Express 2017不支持编译CoreCLR。
CMake
要编译CoreCLR需要CMake 3.7.2及以上版本记得加环境变量Path。
Python
官方给出的所需版本为 python 2.7.9但是python 3也能很好的支持记得加环境变量Path。
Git
这个是必需的嘛。
PowerShell
Windows 10 自带4.0所以Win10就没问题。
DotNet Core SDK
不需要解释吧没有去官网下载吧。
windows编译
其实这部分有个小插曲就是如果使用Visual Studio 2017编译的话会有一个小BUG文档上给的例子是直接运行命令: ./build.cmd
但是会得到如下结果
Microsoft.CSharp.Core.targets(106,11): error MSB4064: The OverrideToolHostparameter is not supported by the Csc task. Verify the parameter exists on the task, and it is a settable public instance property.
BUG的地址如下https://github.com/dotnet/coreclr/issues/10056
运行下面三条命令其中之一就可以解决这个问题了解决方法如下
build x64 skiptests -- /p:CSharpCoreTargetsPathRoslyn\Microsoft.CSharp.Core.targetsbuild x64 checked skiptests -- /p:CSharpCoreTargetsPathRoslyn\Microsoft.CSharp.Core.targetsbuild x64 release skiptests -- /p:CSharpCoreTargetsPathRoslyn\Microsoft.CSharp.Core.targets
推荐第一条命令生成DEBUG版本。 三、CoreCLR for Linux
这里使用Windows 10编译Linux版本是因为Win10里带有Bashbash是一个基于Ubuntu 14.04的Windows子系统可以“完美”模拟Linux环境当然下面所讲的过程也完全可以在真正的Ubuntu上编译。
系统
官方推荐的是ubuntu 14.04当然也可以是别的Linux版本本文也是使用这个版本进行的。
系统组件
cmakellvm-3.5clang-3.5lldb-3.6lldb-3.6-devlibunwind8libunwind8-devgettextlibicu-devliblttng-ust-devlibcurl4-openssl-devlibssl-devuuid-devgit
要安装lldb-3.6需要在Ubuntu上添加安装源
echo deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main | sudo tee /etc/apt/sources.list.d/llvm.listwget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -sudo apt-get update
如果系统里没有git的话需要自己安装下。接着要安装组件命令如下
sudo apt-get install cmake llvm-3.5 clang-3.5 lldb-3.6 lldb-3.6-dev libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev libssl-dev uuid-dev
Linux编译
./build.sh 四、总结
Linux上的编译相对比较简单但是如果是DEBUG的话Windows版本要很容易实现。编译两个版本的过程中会经过漫长的等待最好找个代理。
下篇文章我会讲下在Windows环境下的调试还有我做的一些小的修改过程。
原文地址http://www.cnblogs.com/maxzhang1985/p/6596776.html .NET社区新闻深度好文微信中搜索dotNET跨平台或扫描二维码关注