2015-01-06 20 views
6

Tôi đã cố gắng biên dịch my project với các hướng dẫn sau để tôi nhận được lỗi sau.Cách giải quyết vấn đề xbuild '.NETPortable, Version = v4.0, Hồ sơ = Profile344' trên Linux

Tập lệnh của tôi;

sudo apt-get install mono-complete 
mozroots --import --sync 
mkdir gthb 
cd gthb/ 
git clone https://github.com/ziyasal/InfluxDB.Net.git 
cd InfluxDB.Net/ 
mono .nuget/NuGet.exe install NUnit.Runners 
mono .nuget/NuGet.exe restore InfluxDB.Net.sln 
xbuild 

Đầu ra;

Version XBuild Động cơ 12.0 Mono, phiên bản 3.2.8.0 Bản quyền (C) 2005-2013 tác giả Mono khác nhau

Build started 2015/01/06 18:31:01.


Dự án "/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net.sln" (target mặc định (s)): Target ValidateSolutionConfiguration: Xây dựng cấu hình giải pháp "Debug | Bất kỳ CPU". Mục tiêu xây dựng: Dự án "/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net/InfluxDB.Net.csproj" ((các) đích mặc định): Mục tiêu RestorePackages: Thi hành: mono --runtime = v4. 0.30319 "/home/ziyasal/gthb/InfluxDB.Net/.nuget/NuGet.exe" cài đặt "/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net/packages.config" -source "" -RequireConsent -solutionDir "/home/ziyasal/gthb/InfluxDB.Net/" Khôi phục các gói NuGet ... Để ngăn NuGet tải xuống các gói trong khi xây dựng, hãy mở hộp thoại Tùy chọn Visual Studio, nhấp vào nút Trình quản lý Gói và bỏ chọn 'Cho phép NuGet tải xuống các gói bị thiếu '. Target PrepareForBuild: Cấu hình: Debug Hệ điều hành: AnyCPU Tạo thư mục "bin/Debug /" thư mục tạo "obj/Debug /" GetReferenceAssemblyPaths Target: /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common .targets: warning: Không thể tìm thấy khung công tác tương ứng với biệt danh khung mục tiêu '.NETPortable, Version = v4.0, Profile = Profile344'. Framework ass tham chiếu ngầm định sẽ được giải quyết từ GAC, có thể không phải là hành vi dự định. /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: lỗi: PCL Reference Assemblies not installed. Tác vụ "GetReferenceAssemblyPaths" thực hiện - FAILED Hoàn thành mục tiêu xây dựng "GetReferenceAssemblyPaths" trong dự án "/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net/InfluxDB.Net.csproj".-- FAILED Xong dự án xây dựng"/Trang chủ/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net/InfluxDB.Net.csproj ".-- FAILED Tác vụ" MSBuild "thực hiện - FAILED Hoàn thành mục tiêu xây dựng" Xây dựng "trong dự án"/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net.sln".-- FAILED Hoàn thành dự án xây dựng "/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net.sln".-- FAILED

Xây dựng FAILED.

Cảnh báo:

/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net.sln (mục tiêu mặc định) -> (Xây dựng mục tiêu) -> /home/ziyasal/gthb/InfluxDB.Net /InfluxDB.Net/InfluxDB.Net.csproj (mục tiêu mặc định) -> /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.mục tiêu (mục tiêu GetReferenceAssemblyPaths) ->

/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: warning : Unable to find framework corresponding to the target framework moniker '.NETPortable,Version=v4.0,Profile=Profile344'. Frame 

tham chiếu lắp ráp công việc sẽ được giải quyết khỏi GAC, có thể không phải là hành vi dự định.

Lỗi:

/home/ziyasal/gthb/InfluxDB.Net/InfluxDB.Net.sln (mục tiêu mặc định) -> (Xây dựng mục tiêu) -> /home/ziyasal/gthb/InfluxDB.Net /InfluxDB.Net/InfluxDB.Net.csproj (mục tiêu mặc định) -> /usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets (GetReferenceAssemblyPaths mục tiêu) ->

/usr/lib/mono/xbuild/12.0/bin/Microsoft.Common.targets: error : PCL Reference Assemblies not installed. 

    1 Warning(s) 
    1 Error(s) 

thời gian trôi qua 00: 00: 03.8459340

Trả lời

12

Cuối cùng, tôi tìm thấy giải pháp (giải pháp thay thế) cho việc này. Tôi đã sao chép .NETPortable (C: \ Program Files (x86) \ Tham chiếu Assemblies \ Microsoft \ Framework.NETPortable) thư mục từ hộp Win của tôi vào hộp Linux (/usr/lib/mono/xbuild-frameworks/).

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 
A7E0328081BFF6A14DA29AA6A19B38D3D831EF 

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 
sudo apt-get install mono-complete 
sudo apt-get install referenceassemblies-pcl 

#Import the root certificates using the mozroots tool 
mozroots --import --sync 

#UPDATE: referenceassemblies-pcl package installs required profiles! 
#####DEPRECATED####### 
#I uploaded .NET Portable folder to temporary place. 
#sudo apt-get install p7zip-full 
#wget https://dl.dropboxusercontent.com/u/33940399/NETPortable.7z 

#Override existing 
#sudo 7z x NETPortable.7z -o/usr/lib/mono/xbuild-frameworks/ -aoa 
#####DEPRECATED####### 
mono .nuget/NuGet.exe restore InfluxDB.Net.sln 

xbuild 

mono packages/NUnit.Runners.2.6.4/tools/nunit-console.exe 
InfluxDB.Net.Tests/bin/Debug/InfluxDB.Net.Tests.dll 

Giờ đây, công cụ này cũng biên dịch tốt!

+0

Bạn có thể gửi một lỗi trên https://bugzilla.xamarin.com/ để tham chiếu đến các tập tin giới thiệu PCL không? Tôi đã có thể mong đợi các referenceassemblies-pcl để cài đặt tất cả mọi thứ bạn cần, nhưng tôi có thể sai. –

+0

OK Tôi thấy vấn đề là gì. Các referenceassemblies-pcl được dựa trên những gì Microsoft phát hành và không phải những gì Visual Studio cài đặt (cũng như những gì có sẵn với Mono trên Mac). Referenceassemblies-pcl thiếu cấu hình 344 là cấu hình bạn đang sử dụng. –

+0

@MattWard Jo vừa đẩy bản cập nhật của gói referenceassemblies-pcl bao gồm Profile344. –

2

Thông báo lỗi cho biết rằng bạn chưa cài đặt các hội đồng tham khảo thư viện lớp di động.

Tôi sẽ xem xét sử dụng phiên bản sau của Mono 3.10 và cài đặt gói referenceassemblies-pcl. Có hướng dẫn chi tiết hơn về cách sử dụng Mono trên Linux Mono website.

http://www.mono-project.com/docs/getting-started/install/linux/

+0

Tôi đã cài đặt gói referenceassemblies-pcl nhưng tôi vẫn gặp lỗi. – ziyasal

Các vấn đề liên quan