3

I have been using xamarin studio, it works fine when I download a sample project from mvvmcross. It compiles and deploys the device perfectly.

But when I open the project in the visual studio, there are a lot of missing packages for some reasons. Is there a way of handling ? I am using Nuget 2.8 in Visual studio 2013

enter image description here

When I open Nuget as follows, there is a button to restore the missing packages. I clicked on it.

enter image description here

Then it is attempting to download the missing packages, and then it realizes there are dependencies as follows:

enter image description here

Then I am attempting to download the dependency manually as follows but it shows the packages has already downloaded but I am still seeing the missing packages in the solution, nothing is affected.

enter image description here

Therefore I am getting hundreds of errors as follows:

enter image description here

When I take a look at the property of missing packages, I see as follows

enter image description here

casillas
  • 16,351
  • 19
  • 115
  • 215
  • Install the MVVMCross nuget package? Although, this could be a version compatibility issue - have you checked your project in Xamarin and VS are using the same .NET version? – Dan Orlovsky Mar 10 '16 at 16:50
  • Can you check the output window and see what the error was? – CodingGorilla Mar 10 '16 at 16:52
  • check that: http://stackoverflow.com/questions/27895504/how-do-i-enable-nuget-package-restore-in-visual-studio-2015 – Marzouk Mar 10 '16 at 16:52
  • I've just downloaded the code from the github and tried to compile on windows machine with visual studio. – casillas Mar 10 '16 at 16:52
  • @CodingGorilla, please see my updated question where I have added error messages. – casillas Mar 10 '16 at 16:55
  • Those are compiler errors, the nuget package manager window shows there were errors restoring the packages. Those errors should be visible in the output window by selecting "Nuget Package Manager" from the drop-down at the top of the window. – CodingGorilla Mar 10 '16 at 16:56
  • That shows there is a dependency error when it is attempting to restore the packages. – casillas Mar 10 '16 at 16:58
  • Sorry, I just looked closer at the second to last image. Can you click on one of the missing dependencies (in the solution explorer) and hit F4 and view the properties. I wonder if the [wrong] path to the package isn't hard coded into the .csproj file. – CodingGorilla Mar 10 '16 at 17:03
  • I have added property of one of the missing package. Please see the last image – casillas Mar 10 '16 at 17:12
  • It's screwed up. Remove all package references and then re-add them. Make sure to clean out the solution, too. You might have to do it manually, deleting the package cache on disk and all package files. Start fresh. –  Mar 10 '16 at 17:32
  • @Will, I could make it. But I have been holding that option as a last option. I wonder why this project works on xamarin studio flawlessly, not in visual studio. I have two machines (windows for visual studio, mac for xamarin studio and downloading the project from the same source and extracting and compiling. Not even adding a single line of code. – casillas Mar 10 '16 at 17:43

2 Answers2

3

You should update your NuGet Package Manager extension in Visual Studio and then try restoring the packages again.

The restore error MvvmCross.Binding already has a dependency defined for MvvmCross.Core is caused by an old version of the NuGet package manager extension not recognising the newer target frameworks that the MvvmCross.Binding NuGet package is using in its group dependencies. This bug has been fixed in a newer version of the NuGet Package Manager.

If you search for the 'already has a dependency defined' error message you will find several cases of this, such as this StackOverflow question, for example:

Can not install NuGet package

Community
  • 1
  • 1
Matt Ward
  • 47,057
  • 5
  • 93
  • 94
0

Right click on the solution in solution explorer and choose 'restore nuget packages'

Undo
  • 25,519
  • 37
  • 106
  • 129
Simon
  • 31
  • 3