MVVM Light Nuget installation on VS2105 - mvvm-light

I am installing the MVVM Light Nuget package into a new blank app (Universal Windows) project. I was expecting the viewmodellocator.cs file to be created along with others, but this did not happen and I was wondering if there is a solution for this?
I am using VS2015 Enterprise edition.
Thanks

Related

Visual Studio 2017 not installing packages for new projects

Recently installed Visual Studio 2017.
Usually, when you create a new project, you immediately fire it up and run the scaffolded code.
Unfortunately for me, the new project doesn't have the required packages making the build fail.
Also, objects in the code are marked as not recognized. This is also correct for javascript dependencies.
4 new projects of different types, same result. Didn't even change the code yet I can't build.
The light bulb icon doesn't even show the dependency. Visual Studio doesn't recognize it.
How come scaffolded code has missing references??
Please help.
Well, this was annoying...
Package restore was disabled.
Enabled it in Visual Studio's options and ran the project.
Packages appeared magically.
Tools > Nuget Package Manager > Package Manager Settings

How to find out if a nuget Package is usable in .NET Core

If i search a nuget package within visual studio or at https://www.nuget.org/, how do i see if the nuget package is usable in .net core?
As far as I know, there is currently no possibility to search directly for nuget packages which can be used in .net core (Source). But can i check it for a specific one?
Currently there is no way to search for packages by target-framework.
You can follow this issue on Github for news/more information

How to Install MVVMLight in Xamarin Studio Xamarin.Forms PCL

I think this is related to this -
Cannot install MvvmLight for Windows Phone 8.1 app project
Trying to install libs only nuget. Seen a PCL version mentioned somewhere but its not in the Nuget list.
Could not install package 'MvvmLightLibs 4.4.32.1'. You are trying to
install this package into a project that targets
'portable-net45+win+MonoAndroid10+MonoTouch10', 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.
When I try to install in Xamarin Studio.
Can I assume that I need the latest version of NuGet and the version 2.8.1 is not new enough in XS?
Does MVVMLight support Xamarin Studio? Does anyone know a workaround, I am currently on Indie license and would love to progress with this on a Forms based prototype.
Looking at the MvvmLightLibs 4.4.32.1 NuGet package it does not have any Portable Class Libraries (PCLs) so you will not be able to install it into a PCL project.
Take a look at the Portable.MvvmLightLibs NuGet package instead. That package has a PCL assembly and you should be able to install it into the Xamarin.Forms PCL project.

Why NuGet is it getting MVVMLight for all frameworks and all platforms?

NuGet is getting MVVMLight binaries for WPF, SL3, SL4, SL5, WP7
I don't really like that.
Is there a way to make it get just for the framework which the project is using?
How is generally NuGet working for other packages, it maybe something which the MVVMLight author should do when creating the NuGet package?
Thanks,
Andrew
It's a nuget convention to include libraries of different framework versions inside a unique package. This makes it easier for the package consumer, there's only one version of a package to install.
When installing a package through NuGet Package Manager (UI or console), NuGet will only add references to libraries that targets your project's framework. Note: all the package content is unpacked to "\packages\", including libraries that aren't used.
Example:
I created a SL4 application and installed MVVMLightLibs. Only GalaSoft.MvvmLight.Extras.SL4 and GalaSoft.MvvmLight.SL4 are added as a reference.
see nuget documentation : Supporting_Multiple_.NET_Framework_Versions_and_Profiles

WPF4 support for MVVM Light Toolkit

When installing the package, I only get binaries for Silverlight 3/4/5 and Windows Phone, nothing for WPF. What I am doing wrong ?
Thanks guys, sorry if my question was not detailed enough.
I've been using the procedure described at Laurent's Website and in the binaries directory, I have only 5 dirs corresponding to Silverlight 3/4/5, WP7 and WP71. Nothing about .Net 4.
I've tried GalaSoft.MvvmLight.V3.0.2.19 and GalaSoft.MvvmLight.V4beta1.4.0.2.19 with the same result.
On the v4 beta 1, the install window doesn't show .Net in the binaries nor the Snippets.
Could this be related to the fact that I'm using Studio 2010 Express despite that Laurent said that his package can also be used with Express? I can understand that for the snippets, not for the binaries.
They're labelled as ".Net 4". Should be there along with Silverlight and Windows Phone 7.
As you did not describe how you installed MVVM Light I cannot answer your question as to what went wrong. However, I can describe the easiest way of including MVVM Light into your project:
Install the NuGet package manager.
Create your project (WPF / SL / WP7).
Install one of the following packages
MVVM Light
This installs version 3 of MVVM Light and also configures your project to the conventions used by MVVM Light.
MVVM Light Libraries Only
Installs only the version 3 libraries, but leaves your project untouched.
MVVM Light [Preview]
Installs version 4 of MVVM Light, including the project conventions.
MVVM Light Libraries Only [Preview]
INstalls the version 4 libraries, but leaves your project unchanged.
Alternatively you can use the installer using the installer and the procedure described at Laurent's web site. If you use this approach the libraries should be installed under %program files%\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Binaries or the path you specified during the install.
The installer is good for installing the templates, snippets, etc., however, for production I strongly recommend using the NuGet packages as they usually offer an upgrade path should there be bugfixes.

Resources