9

I am trying to install MVVMCross NuGet package using NuGet 2.5 version. I have added the mono android and touch file to Profile104 folder. Still I am getting following exception:

Attempting to resolve dependency 'MvvmCross.HotTuna.StarterPack (≥ 3.0.6)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.0.6)'.
Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.0.6)'.
Installing 'MvvmCross.PortableSupport 3.0.6'.
Successfully installed 'MvvmCross.PortableSupport 3.0.6'.
Installing 'MvvmCross.HotTuna.CrossCore 3.0.6'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.0.6'.
Installing 'MvvmCross.HotTuna.StarterPack 3.0.6'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.0.6'.
Installing 'MvvmCross 3.0.6'.
Successfully installed 'MvvmCross 3.0.6'.
Adding 'MvvmCross.PortableSupport 3.0.6' to PortableClassLibrary1.
Uninstalling 'MvvmCross.PortableSupport 3.0.6'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.0.6'.
Install failed. Rolling back...
Could not install package 'MvvmCross.PortableSupport 3.0.6'. 

You are trying to install this package into a project that targets 'portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp', 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.

I have selected following option when creating a new PCL Library project

enter image description here

Following are the content for the xml files from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks folder

.NET for Windows Store apps.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework
    Identifier=".NETCore"
    Profile="*"
    MinimumVersion="4.5"
    DisplayName=".NET for Windows Store apps"
    MinimumVersionDisplayName="" />

.NET Framework 4.5

<?xml version="1.0" encoding="utf-8"?>
<Framework
    Identifier=".NETFramework"
    Profile="*"
    MinimumVersion="4.5"
    DisplayName=".NET Framework"
    MinimumVersionDisplayName="4.5" />

MonoAndroid.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework DisplayName="Mono for Android"
  Identifier="MonoAndroid"
  Profile="*"
  MinimumVersion="1.6"
  MaximumVersion="*" />

MonoTouch.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework
    DisplayName="MonoTouch"
    Identifier="MonoTouch"
    Profile="*"
    MaximumVersion="*" 
    MinimumVersion="4.0" />

Silverlight 4.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework
    Identifier="Silverlight"
    Profile=""
    MinimumVersion="4.0"
    DisplayName="Silverlight"
    MinimumVersionDisplayName="4" />

VSMonoTouch.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework DisplayName="VS MonoTouch"
  Identifier=".NETFramework"
  Profile="*"
  MinimumVersion="1.0"
  MaximumVersion="1.0" />

Windows Phone 7.5.xml

<?xml version="1.0" encoding="utf-8"?>
<Framework
    Identifier="Silverlight"
    Profile="WindowsPhone7*"
    MinimumVersion="4.0"
    DisplayName="Windows Phone"
    MinimumVersionDisplayName="7.5" />

I am using Visual Studio 2012 Ultimate Update 2 on Windows Server 2012 64 bit edition. Can someone point me in right direction.

Amit Rai Sharma
  • 4,015
  • 1
  • 28
  • 35
  • 1
    My guess is that the problem is "win" or "wp" - but don't know... Have added pcl as a tag and reached out to pcl gurus :) – Stuart May 13 '13 at 20:10
  • @Stuart: Thank you for adding the PCL tag. By the way I am new to mobile development and have learned a lot in today's MvvM C# event. It was very informative. Thanks once again :) – Amit Rai Sharma May 13 '13 at 21:52
  • I know you've mentioned you're using NuGet 2.5. But would you make sure you're using the latest version again (compare it to http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c) I had a similar issue and the solution was updating NuGet – Shady M. Najib Jun 10 '13 at 14:50
  • I having the same problem. I'm on VS 2010, so I had to first install the plugin for PCL support. Then I added the files suggested [here](http://slodge.blogspot.co.uk/2012/12/cross-platform-winrt-monodroid.html) for monoandroid and monovstouch, but no luck so far. – Matt Burland Jun 11 '13 at 20:37
  • 1
    Actually, following [this](http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html) link and replacing vsmonotouch with monotouch, restarting, selecting monotouch, android and windows phone 7.5, it now worked! – Matt Burland Jun 11 '13 at 20:42

6 Answers6

5

It looks like you are targeting Windows Phone 7.0 in your Portable Class Library. Try switching to Windows Phone 7.5 and see if that helps. If not, try posting a screenshot of the PCL "choose targets" screen, as well as the contents of all the XML files you've added to the "SupportedFrameworks" folder.


EDIT: Try deleting VSMonoTouch.xml (and restarting Visual Studio afterwards).

Daniel Plaisted
  • 16,674
  • 4
  • 44
  • 56
  • 2
    @ARS Try deleting VSMonoTouch.xml (and restarting Visual Studio afterwards). – Daniel Plaisted May 14 '13 at 00:43
  • 1
    @ARS VSMonoTouch is brilliant - saved me loads of time for 15 months - but it does have an issue that it lists mt's .net framework version as 1.0 - so that may be the problem here – Stuart May 14 '13 at 06:21
  • @Stuart Thanks for the input. I will try this and will post the outcome :) – Amit Rai Sharma May 14 '13 at 08:55
  • @DanielPlaisted I will try it and will post the outcome. – Amit Rai Sharma May 14 '13 at 09:08
  • @Stuart I am getting same exception after deleting VSMonoTouch.xml. – Amit Rai Sharma May 14 '13 at 09:51
  • @DanielPlaisted I am getting same exception after deleting VSMonoTouch.xml – Amit Rai Sharma May 14 '13 at 09:51
  • 1
    If all else fails, you can use the prebuilt binaries and steps like in http://www.codeproject.com/Articles/566270/MvvmCross-TipCalc-Step-1-Creati - but hopefully someone will know what this pcl or nuget config issue is... – Stuart May 14 '13 at 18:28
  • One more idea... while waiting you can try to build projects using http://adriansudbury.blogspot.co.uk/2013/05/ninja-coders-for-mvvmcross-part-2.html – Stuart May 14 '13 at 18:33
  • @Stuart There is definitely some issue with the nuget package or the pcl. I can compile and run TipCal sample without any problem. – Amit Rai Sharma May 14 '13 at 21:23
  • Sorry - don't understand your logic leading to 'definitely'. There are plenty of people installing these packs into PCLs fine - so I can guess that there's something different in your setup. Whether that's an issue with the package, 'the pcl', with NuGet, with WinServer2012, with WP or with your setup... that's not something I know yet. Will keep trying to push people here to see if they can help. – Stuart May 15 '13 at 14:19
  • @Stuart I might have jumped to the conclusion too quickly.. It might be the setup or something else. However the fact is that there is an issue which almost wasted couple of hours of my life. I am thankful to you for your valuable suggestion which helped me in proceeding further :) – Amit Rai Sharma May 15 '13 at 22:16
2

The workaround mentioned on a comment on Stuart's blog (at http://slodge.blogspot.co.uk/2013/04/n0-first-mvvmcross-application-n1-days.html) worked for me:

Remove Mono for Android, MonoTouch, VS MonoTouch and Windows Phone from the Target Frameworks in the Core project properties. Install MvvmCross NuGet package. Add the Target Frameworks back in.

Neil
  • 159
  • 10
2

I just got an update to the NuGet. It looks like it's working now.

Here are the steps to have MVVM Cross on a new project:

  1. Create a new project Xamarin Android

  2. Create a new project PCL library (select Mono Android, MonoTouch, and Windows Phone 7.5 and higher).

  3. Add MVVMCross NuGet on both the app and PCL

  4. Add the library as reference to the app

Without adding the MVVMCross also to the app, I get an error on compilation.

WriteEatSleepRepeat
  • 3,083
  • 3
  • 33
  • 56
1

I have the same issue

Could not install package 'MvvmCross.PortableSupport 3.0.6'. You are trying to install this package into a project that targets 'portable-win+net45+MonoAndroid16+MonoTouch40+sl40+wp71', 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.

Per http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html, I do not have VSMonoTouch, just the two files (MonoAndroid,Version=v1.6+.xml and MonoTouch,Version=v1.0+.xml)

I also tried to

"Remove Mono for Android, MonoTouch, VS MonoTouch and Windows Phone from the Target Frameworks in the Core project properties. Install MvvmCross NuGet package. Add the Target Frameworks back in."

But when I try to compile, I get this error:

Error 1 Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Perhaps it doesn't exist in the Mono for Android profile? File name: 'System.Windows.dll' at Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly) at Xamarin.Android.Tasks.ResolveAssemblies.Execute() MyProject

WriteEatSleepRepeat
  • 3,083
  • 3
  • 33
  • 56
1

I face this issue too. After googling to find solution I found that I use Nuget version 2.4 I upgrade my nuget to 2.6 and it run smoothly. You can download nuget 2.6 here: Nuget 2.6

Ha Doan
  • 611
  • 6
  • 20
  • After creating the files in the supported Frameworks folder I was still having problems. I actually had to uninstall and re-install Nuget before this worked. Thanks for the tip. – Clint Good Sep 07 '13 at 12:28
0

I wrote a step by step post for creating a simple Android app from scratch using PCL

http://enginecore.blogspot.ro/2013/05/first-app-with-xamarin-android-and.html

WriteEatSleepRepeat
  • 3,083
  • 3
  • 33
  • 56