NuGet keeps ignoring "allowedVersion" - visual-studio-2013

I'm using NuGet in VS 2013 and try to limit the JQuery Package to version 1.x (instead of 2.x)
Here is what I have in my packages.conf
<package id="jQuery" version="1.11.2" targetFramework="net45" allowedVersion="[1,2)" />
Which to my knowledge tells nuget to exclude versions starting with 2
Now, when I run the following command in the console to see what would be updated.
Update-Package -ProjectName Website -WhatIf
it shows me
Updating 'jQuery' from version '1.11.2' to '2.1.3' in project 'Website'.
Remove 'jQuery 1.11.2' from project Website.
Add 'jQuery 2.1.3' to project Website.
Which is not what I expected. Why does nuget want to update to version 2.1.3 even when I said exclude this version.
Am I missing something here?

This is not working because the attribute should be allowedVersions and not allowedVersion. The following entry in the packages.config file should as you are expecting it to.
<package id="jQuery" version="1.11.2" targetFramework="net45" allowedVersions="[1,2)" />

Related

Could not install package 'Xamarin.GooglePlayServices.Maps 60.1142.1' [duplicate]

I am trying to use google maps on my xamarin forms application. I installed Google.forms.maps. With that installation, I got below packages:
<package id="Xamarin.GooglePlayServices.Base" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Basement" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Maps" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Tasks" version="42.1021.1" targetFramework="monoandroid71" />
As soon as I start running the application, these dll's go away from android project reference and I get the error
Severity Code Description Project File Line Suppression State
Error Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Tasks' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Base' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Maps' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Basemant' app1.Android
I googled for this error and tried to add these packages separately using nuget so I did this
Install-Package Xamarin.GooglePlayServices.Base -Version 60.1142.0
I got an error saying
Install-Package : Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', 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.
so I tried doing this:
Install-Package Xamarin.GooglePlayServices.Base -Version 29.0.0.1
I got the same error as I got with nuget package version 60.1142.0
I am using Visual studio 2017 enterprise version.
any help in this regards will be appreciated. Below are the target for android project:
My target framework is like this:
and The sdk Picture is like this:
Below is the visual studio Help-> about window.
Generic message:
Could not install package 'Xamarin.XXXXXXX'. You are trying to install this package into a project that targets 'MonoAndroid,Version=vX.X'
Specific message:
Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1'
Change your Xamarin.Androidproject to target at least MonoAndroid 8.0 as Xamarin.GooglePlayServices.Base v60.1142.0 has a dependency on 8.0
Nuget: Xamarin.GooglePlayServices.Base/60.1142.0
Dependencies

missing xamarin.googleplayservices references

I am trying to use google maps on my xamarin forms application. I installed Google.forms.maps. With that installation, I got below packages:
<package id="Xamarin.GooglePlayServices.Base" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Basement" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Maps" version="42.1021.1" targetFramework="monoandroid71" />
<package id="Xamarin.GooglePlayServices.Tasks" version="42.1021.1" targetFramework="monoandroid71" />
As soon as I start running the application, these dll's go away from android project reference and I get the error
Severity Code Description Project File Line Suppression State
Error Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Tasks' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Base' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Maps' app1.Android
Did not find reference matching RestoreAssemblyResources AssemblyName metadata 'Xamarin.GooglePlayServices.Basemant' app1.Android
I googled for this error and tried to add these packages separately using nuget so I did this
Install-Package Xamarin.GooglePlayServices.Base -Version 60.1142.0
I got an error saying
Install-Package : Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1', 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.
so I tried doing this:
Install-Package Xamarin.GooglePlayServices.Base -Version 29.0.0.1
I got the same error as I got with nuget package version 60.1142.0
I am using Visual studio 2017 enterprise version.
any help in this regards will be appreciated. Below are the target for android project:
My target framework is like this:
and The sdk Picture is like this:
Below is the visual studio Help-> about window.
Generic message:
Could not install package 'Xamarin.XXXXXXX'. You are trying to install this package into a project that targets 'MonoAndroid,Version=vX.X'
Specific message:
Could not install package 'Xamarin.GooglePlayServices.Base 60.1142.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v7.1'
Change your Xamarin.Androidproject to target at least MonoAndroid 8.0 as Xamarin.GooglePlayServices.Base v60.1142.0 has a dependency on 8.0
Nuget: Xamarin.GooglePlayServices.Base/60.1142.0
Dependencies

LNK1104 Visual studio 2015

I am trying to build Caffe Deep Learning Network solution using Windows and I have literally tried everything to make it work.
I found similar questions, but they were using VS 2010 or 2013 and I don't have any of the options listed in most of the answers.
Firstly:
I am using VS 2015, cudNN and latest Caffe, and I am trying to build it using Windows x64.
Secondly:
I have tried two approaches (started off with adding cudNN path in both cases)
1)
Reference: http://embedonix.com/articles/machine-learning/compiling-caffe-with-cuda-and-cudnn-support-on-windows-from-source/2/
I have used this command:
nuget restore Caffe.sln -PackagesDirectory ..\..\NugetPackages -ConfigFile nuget.config
then launched Visual Studio and tried to build the solution, but I get this error:
LNK1104 cannot open file 'libboost_date_time-vc140-mt-gd-1_59.lib' classification
2) I tried using this method:https://github.com/BVLC/caffe/tree/windows, which is from their oficial website.
But I am getting error: "The procedure entry point_CrtSetCheckCOunt could not be located in the dynamic link library... protoc.exe"
Does anyone have a solution of how to solve any of these issues,so I could install it?
I am facing a simmilar issue.
One of the libraries your code depends on does depend on boost.
Your code now also needs to import boost.
Luckily there are boost packages available via nuget. You need to recursibely manually check them all out until the errors are gone. The first one would be boost_date_time.
My packages file now looks like this:
<packages>
<package id="boost" version="1.63.0.0" targetFramework="native" />
<package id="boost_atomic-vc140" version="1.63.0.0" targetFramework="native" />
<package id="boost_chrono-vc140" version="1.63.0.0" targetFramework="native" />
<package id="boost_date_time-vc140" version="1.63.0.0" targetFramework="native" />
<package id="boost_filesystem-vc140" version="1.63.0.0" targetFramework="native" />
<package id="googletest" version="1.8.0.0" targetFramework="native" />
</packages>
This works because the project targets are now beeing extended and you get the path to the directory of the lib file as additional library directory added to the project.
The next error you may get now is LNK2019 and that would be connected to all or parts of the boost library beeing linked in dynamically in your dependency. The solution for me is different for the solution for you here - but I am sure there is a Caffe specific solution available.

EF with Oracle in Visual Studio error message?

I'm helping a colleague to get his Visual Studio 2013 set up so that he can use EF with Oracle. We are getting an error message "Your project references the latest version of Entity Framework; however, an Entity Framework database provider compatible with this version could not be found". We used NuGet to install the Oracle.Managed driver first and the Oracle.Manged.EntityFramework. When we look at the properties of Oracle.Manged driver int he project the runtime version is "v4.0.30319".
We are able to connect to Oracle using the TNSname with LinqPad and TOAD.
I'm able to get EF with Oracle to work in my VS 2013 following the same steps so I know it should be able to work. I just don't know what to check on his machine to find out what the difference between our machines are.
I'm looking for any suggestions on what I can look at.
We are using this config (packages.config):
<package id="EntityFramework" version="6.1.3" targetFramework="net45" />
<package id="Oracle.ManagedDataAccess" version="12.1.022" targetFramework="net45" />
<package id="Oracle.ManagedDataAccess.EntityFramework" version="12.1.022" targetFramework="net45" />
and it is working. To download version specific nuget:
Install-Package Oracle.ManagedDataAccess -Version 12.1.022
EntityFramework 6.1.3 is the latest now and this version of the Oracle driver can work with it.

Nuget installs old version of package Newtonsoft.Json because of WebAPI dependency

I have a website and dll project.
In dll packages.config I used package:
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net451" />
In web site packages.config I use package:
<package id="Microsoft.AspNet.WebApi" version="5.1.2" targetFramework="net451" />. This package has dependency "Newtonsoft.Json with version >= 4.5.11"
I added also line:
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="net451" />
when I launch "Update-Package -ReInstall" nuget checks that Microsoft.AspNet.WebApi depends on Newtonsoft.Json, then nuget overwrites web site packages.config with line
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net451" /> and copies Newtonsoft.Json 4.5.11 into "bin" folder of site.
Also bin folder has my dll that depends on fresh version of newtonjson and it does not work..
I tried command "Update-Package -Reinstall -IgnoreDependencies". It helped partially: now I have 6.0.3 in website/bin. But there are 2 issues: should all developers on project use only "Update-Package -Reinstall -IgnoreDependencies"? They cannot launch update of nuget from GUI?
Project that not start, some dll references Newtonsoft.Json 4.5.0 (I have no exact error message because of using dependency injection).
Does anyone know:
* how to normally tell to nuget to download newtonsoft 6.0.3 to work it normally in gui? Is there any option in packages.config for this?
* if I use newtonsoft json 6.0.3, should i use bindingRedirect to fix version on assembly for webapi?
Thanks a lot!!!
OK, I found the reason of issue
After editing packages.config for dll project and Update-Package -Reinstall command for dll project, nuget downloaded right version of Newtonsoft.Json (6.0.3) for dll project, but did not refresh path in references of project. Thus solution - do not edit packages.config manually. Only launch nuget commands from package manager console or gui.
Yes, bindingRedirect helped for the second problem

Resources