Issue in adding MVVMLight (PCL) in Portable class library project via nuGet.

Mar 21, 2013 at 6:18 AM
Hi,

I have created a new Portable Class Library Project in VS 2012.
However when i add the MVVM Light PCL version into my project through nuGet I get "Operation Failed" with message "Portable.MVVMLightLibs already has a dependency defined for "PortableCommonServiceLocator".

Need the solution asap.

Cheers
Mar 22, 2013 at 12:45 PM
Hi,

Do you have the latest NuGet installed (version 2.2)?

Can you share a bit more about your project? What platforms is it targeting? Is this a new project or are there existing references? What NuGet packages are already in the project?

Regards,
Oren
Mar 25, 2013 at 12:28 PM
Hi Oren,

I have updated my NuGet to the latest version(2.2) installed.
However I get the below message when I try to install "MVVM Light Libraries only (PCL)".
"Could not install package 'Portable.MvvmLightLibs 4.1.27.3'. You are trying to install this package into a project that targets 'portable-win+net45+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."

This is a new project (Portable Class Library Project) targeting ".net4.5, sl4+, WP7+, WinRT" using C#. The project does not contain any NuGet Packages.

Regards,
Manvik
Mar 25, 2013 at 12:31 PM
Hi Manvik,

The PCL requires at least WP 7.5. If you update your PCL project settings it should then install for you.

Regards,
Oren
Mar 26, 2013 at 8:19 AM
Hi Oren,

Thanks for the solution. I am able to add MVVM Light (PCL) to my project.

I have one more question
  1. I want to use this PCL in my Windows 8 app project. How do I go about it. And both my projects require MVVM Light
Regards,
Manvik
Dec 8, 2013 at 10:52 AM
Edited Dec 8, 2013 at 10:52 AM
Changing PCL to support WindowsPhone OS 7.1 did not do the trick.

Could not install package 'Portable.MvvmLightLibs 4.2.30.1'. You are trying to install this package into a project that targets 'portable-win+net45+sl40+wp71', but the package does not contain any assembly references or content files that are compatible with that framework.
Dec 8, 2013 at 2:12 PM
Edited Dec 8, 2013 at 2:22 PM
Hi Brilbroeder,

The latest MVVMLight PCL supports only WP8 and up. SL4 and WP 7.x were dropped. If you need WP7.x support, the last release to support those are the 4.1.27 series. They can be installed via NuGet by using the package manager console:

https://www.nuget.org/packages/Portable.MvvmLightLibs/4.1.27.6

Install-Package Portable.MvvmLightLibs -Version 4.1.27.6
Dec 8, 2013 at 4:23 PM
Thx onovotny. Your Tip solved my problem.