在Ubuntu 14.04上设置CoreCLR和CoreFX

时间:2015-10-22 20:31:36

标签: .net mono coreclr

我试图在Ubuntu 14.04计算机上运行CoreCLR和CoreFX。

似乎所有内容都已正确构建,但是当我尝试使用它运行程序时,我收到以下错误:

  

./ corerun HelloWorld.exe

     

断言失败(PID 6093 [0x000017cd],线程:6093 [0x17cd]):!"递归> CLRException :: GetThrowable"      文件:/home/ubuntu/git/coreclr/src/vm/clrex.cpp行:150      图片:/ home / ubuntu / coreclr-demo / runtime / corerun

     

****调用MessageBox,标题' corerun - 断言失败(PID 6093,线程6093 / 0x17cd)' ****    !" CLRException :: GetThrowable"

中的递归      

/home/ubuntu/git/coreclr/src/vm/clrex.cpp,行:150

以下是我用来设置所有内容的步骤:

1)设置工具链:

echo "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.6 main" | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
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 uuid-dev

2)设置回购:

sudo apt-get install git
mkdir ~/git
mkdir ~/git/coreclr
mkdir ~/git/corefx
cd ~/git
git clone https://github.com/dotnet/coreclr.git
git clone https://github.com/dotnet/corefx.git

3)安装Mono:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-devel

4)构建CoreCLR:

cd ~/git/coreclr
./build.sh

5)为运行时和复制文件设置目录

mkdir -p ~/coreclr-demo/runtime
cp ~/git/coreclr/bin/Product/Linux.x64.Debug/corerun ~/coreclr-demo/runtime
cp ~/git/coreclr/bin/Product/Linux.x64.Debug/libcoreclr.so ~/coreclr-demo/runtime
cp ~/git/coreclr/bin/Product/Linux.x64.Debug/mscorlib.dll ~/coreclr-demo/runtime

6)构建框架

echo "deb http://jenkins.mono-project.com/repo/debian sid main" | sudo tee /etc/apt/sources.list.d/mono-jenkins.list
sudo apt-get update
sudo apt-get install mono-snapshot-latest referenceassemblies-pcl
sudo apt-get install libcurl4-openssl-dev
mozroots --import --sync
cd ~/git/corefx
./build.sh

cp ~/git/corefx/bin/Linux.x64.Debug/Native/*.so ~/coreclr-demo/runtime
cp ~/git/corefx/bin/Linux.AnyCPU.Debug/System.Console/System.Console.dll ~/coreclr-demo/runtime
cp ~/git/corefx/bin/Linux.AnyCPU.Debug/System.Diagnostics.Debug/System.Diagnostics.Debug.dll ~/coreclr-demo/runtime

7)下载依赖关系:

mkdir ~/coreclr-demo/packages
cd ~/coreclr-demo/packages
curl -L -O https://nuget.org/nuget.exe

nano packages.config

将以下内容贴上新包装。确认文件:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="System.Console" version="4.0.0-beta-22703" />
  <package id="System.Diagnostics.Contracts" version="4.0.0-beta-22703" />
  <package id="System.Diagnostics.Debug" version="4.0.10-beta-22703" />
  <package id="System.Diagnostics.Tools" version="4.0.0-beta-22703" />
  <package id="System.Globalization" version="4.0.10-beta-22703" />
  <package id="System.IO" version="4.0.10-beta-22703" />
  <package id="System.IO.FileSystem.Primitives" version="4.0.0-beta-22703"/>
  <package id="System.Reflection" version="4.0.10-beta-22703" />
  <package id="System.Resources.ResourceManager" version="4.0.0-beta-22703"/>
  <package id="System.Runtime" version="4.0.20-beta-22703" />
  <package id="System.Runtime.Extensions" version="4.0.10-beta-22703" />
  <package id="System.Runtime.Handles" version="4.0.0-beta-22703" />
  <package id="System.Runtime.InteropServices" version="4.0.20-beta-22703"/>
  <package id="System.Text.Encoding" version="4.0.10-beta-22703" />
  <package id="System.Text.Encoding.Extensions" version="4.0.10-beta-22703"/>
  <package id="System.Threading" version="4.0.10-beta-22703" />
  <package id="System.Threading.Tasks" version="4.0.10-beta-22703" />
</packages>

mono nuget.exe restore -Source https://www.myget.org/F/dotnet-corefx/ -PackagesDirectory .
find . -wholename '*/aspnetcore50/*.dll' -exec cp -n {} ~/coreclr-demo/runtime \;

8)编译测试应用程序:

cd ~/coreclr-demo/runtime
curl -O https://raw.githubusercontent.com/dotnet/corefxlab/master/demos/CoreClrConsoleApplications/HelloWorld/HelloWorld.cs
mcs /nostdlib /noconfig /r:../packages/System.Console.4.0.0-beta-22703/lib/contract/System.Console.dll /r:../packages/System.Runtime.4.0.20-beta-22703/lib/contract/System.Runtime.dll HelloWorld.cs

9)运行应用程序:

./corerun HelloWorld.exe

我应该采取哪些不同的方式来实现这一目标?

0 个答案:

没有答案