簡體   English   中英

Xamarin.Forms在Xamarin工作室

[英]Xamarin.Forms in Xamarin Studio

我下載了Xamarin Studio來構建我的第一個應用程序,但是我遇到了一些我沒有找到解決方案的問題。

首先,我使用App Xamarin.Forms Blank模板創建了一個新的解決方案。 當我嘗試構建它時,出現了一些錯誤(我沒有從模板中更改一行):


The type or namespace name 'Xamarin' could not be found (are you mission a using directive or an assembly reference?)
The type or namespace name 'Application' could not be found (are you mission a using directive or an assembly reference?)

然后我認為Xamarin.Forms包丟失了,所以我點擊了Project> Add NuGet Packages ...我嘗試安裝Xamarin.Forms包。 這是我卡住的地方,因為顯示了一個新錯誤:


Could not install package 'Xamarin.Forms 1.3.3.6323'. You are trying to install this package into a project that targets 'portable-Profile78', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

我會感激任何幫助,因為我沒有找到任何解決方案。

錯誤消息表明您沒有安裝可移植類庫(PCL)。

如果您使用的是Mac,則可以通過安裝Mono Development Kit(MDK)來安裝這些軟件。

如果你在Windows上,程序有點棘手。 要在Windows上安裝可移植類庫,您有三個選擇:

  1. 安裝Visual Studio 2013(完整版或Express版)。 需要更新2或更高版本。
  2. 安裝可移植庫工具可移植庫參考程序集4.6
  3. 安裝可移植庫工具並將.NETPortable目錄從Mono復制到Windows。

2.的一個問題是安裝可移植庫參考組件4.6不會將它們安裝到正確的位置,而只是將PortableReferenceAssemblies.zip文件安裝到目錄中:

C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6

此PortableReferenceAssemblies.zip文件包含三個目錄(4.0,4.5和4.6),需要將其解壓縮並復制到PCLs目錄中:

 C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable

有關Xamarin Studio安裝可移植類庫的詳細信息,但上面的內容應該概述了所需的內容。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM