2014-05-06 124 views
0

有許多報告說MvvmCross可以安裝在配置文件78中,但在我的環境中不能。無法從Xamarin Studio上的Nuget管理器安裝MvvmCross

當我嘗試的NuGet經理安裝MvvmCross,我得到以下信息:

Could not install package 'MvvmCross.PortableSupport 3.1.1'. 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. System.InvalidOperationException: Could not install package 'MvvmCross.PortableSupport 3.1.1'. 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.

Environmrnt是:

=== Xamarin Studio === 

Version 4.2.4 (build 35) Installation UUID: 7b4d01c4-ec8d-4fd7-bcf3-46ea74a47d8b Runtime: 
    Mono 3.2.6 ((no/9b58377) 
    GTK+ 2.24.23 (Raleigh theme) 

    Package version: 302060000 

=== Apple Developer Tools === 

Xcode 5.1.1 (5085) Build 5B1008 

=== Xamarin.iOS === 

Version: 7.2.1.42 (Business Edition) Hash: 773c77c Branch: Build date: 2014-04-18 15:39:16-0400 

=== Xamarin.Mac === 

Xamarin.Mac: Not Installed 

=== Xamarin.Android === 

Version: 4.12.3 (Business Edition) Android SDK: /adt-bundle-mac/sdk 
    Supported Android versions: 
     2.1 (API level 7) 
     2.2 (API level 8) 
     2.3 (API level 10) 
     3.1 (API level 12) 
     4.0 (API level 14) 
     4.0.3 (API level 15) 
     4.1 (API level 16) 
     4.2 (API level 17) 
     4.3 (API level 18) 
     4.4 (API level 19) Java SDK: /usr java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) 

=== Build Information === 

Release ID: 402040035 Git revision: 1173cb1c45bc56cb702e82cd21a7c9d0cea4acbf Build date: 2014-04-17 13:45:52-04 Xamarin addins: 53bde0041263928e8bd64686f5ca5a8e4338dd76 

=== Operating System === 

Mac OS X 10.9.2 Darwin ootsuka-no-MacBook-Air.local 13.1.0 Darwin Kernel Version 13.1.0 
    Wed Apr 2 23:52:02 PDT 2014 
    root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64 

和的NuGet經理是0.9,最新的版本。

我當時的解決辦法嘗試:

  • 我更新了所有Xamarin組件,XS,單聲道,XA和XIOS。但它無法解決問題。
  • 我卸載了Nuget管理器並重新安裝它 - 沒有解決問題。
  • 我在配置文件7中製作了PCL項目,然後安裝MvvmCross成功。
    因此,我將項目更改爲配置文件78,並手動更改package.config。
    這適用於iOS和Android,但我僅在示例代碼中進行了測試。

有人可以提出一個更好的方法來解決這個問題嗎?

+0

嘗試更新您的Xamarin工作室 – choper

回答

2

由於某種原因,您似乎沒有安裝PCL配置文件78。

我基於這樣的事實,我期望NuGet報告的錯誤消息包含框架名稱並且不使用配置文件名稱。例如,當我嘗試Microsoft.AspNet.Razor 3.1.2安裝到靶向資料78項目中,我得到的錯誤:

Could not install package 'Microsoft.AspNet.Razor 3.1.2'. 
You are trying to install this package into a project that targets 
'portable-net45+wp80+win+MonoAndroid10+MonoTouch10'. 

我可以安裝MvvmCross.PortableSupport 3.1.1進入爲目標的PCL項目配置文件78在Mac上使用Xamarin Studio 4.2.4和Mono 3.2.6。

您可以嘗試重新安裝Mono以嘗試修復此問題。但是你說你已經試過了。

我也有一個simple C# console application,你可以用它來顯示你的機器上安裝的PCL配置文件。從這個輸出我的Mac上使用Mono 3.2.6安裝是:

.NETPortable root path found: /Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.5/../xbuild-frameworks/.NETPortable 

.NETPortable profiles: 
Profile136 net40+sl50+wp80+win+MonoAndroid10+MonoTouch10 
Profile14 net40+sl50+MonoAndroid10+MonoTouch10 
Profile147 net403+sl50+wp80+win+MonoAndroid10+MonoTouch10 
Profile158 net45+sl50+wp80+win+MonoAndroid10+MonoTouch10 
Profile19 net403+sl50+MonoAndroid10+MonoTouch10 
Profile24 net45+sl50+MonoAndroid10+MonoTouch10 
Profile37 net40+sl50+win+MonoAndroid10+MonoTouch10 
Profile42 net403+sl50+win+MonoAndroid10+MonoTouch10 
Profile47 net45+sl50+win+MonoAndroid10+MonoTouch10 
Profile5 net40+win+MonoAndroid10+MonoTouch10 
Profile6 net403+win+MonoAndroid10+MonoTouch10 
Profile49 net45+wp80+MonoAndroid10+MonoTouch10 
Profile7 net45+win+MonoAndroid10+MonoTouch10 
Profile78 net45+wp80+win+MonoAndroid10+MonoTouch10 

您還可以看看/Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/xbuild -frameworks/.NETPortable目錄並查看那裏有哪些配置文件。

+0

謝謝!至於你說的,我想你的應用程序,顯示出這一點: Profile1的net40 + WIN + SL40 + WP + Xbox40 Profile104 net45 + WIN + SL40 + wp71 Profile131 net403 + WIN + SL40 + WP + Xbox40 Profile14 net40 + SL50 Profile18 net403 + SL40 Profile19 net403 + SL50 Profile2中net40 + WIN + SL40 + WP Profile23 net45 + SL40 Profile24 net45 + SL50 Profile3的net40 + SL40 Profile36 net40 + WIN + SL40 Profile37 net40 + WIN + SL50 – kochizufan

+0

Profile4 net45 + win + sl40 + wp Profile41 net403 + win + sl40 Profile42 net403 + win + sl50 Profile46 net45 + win + SL40 Profile47 net45 + WIN + SL50 規範5 net40 +贏得 Profile6 net403 +贏得 Profile88 net40 + WIN + SL40 + wp71 Profile95 net403 + WIN + SL40 + WP Profile96 net403 + WIN + SL40 + wp71 Profile7 net45 + win – kochizufan

+0

我的環境可能的可移植方式是: /Library/Frameworks/Mono.framework/External/xbuild-frameworks/.NETPortable /Library/Frameworks/Mono.framework/Versions/3.2.6/lib/mono/4.5/ ../xbuild-frameworks/.NETPortable 後來包括P78但前者不是,但我的Xamarin使用前者作爲根路徑。 – kochizufan

相關問題