I'm trying to install this library in an existing c++ project with NuGet, but the installation stops and give me the following message:
Could not install package '32feet.NET 3.5.0.0'. You are trying to install this package into a project that targets 'Native,Version=v0.0', 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.
What does this mean?
Looks like NuGet currently doesn't support that:
http://nuget.codeplex.com/workitem/3665
https://nuget.codeplex.com/workitem/3530
Related
When importing existing library projects into an existing solution (after I copied them locally from somewhere else), when I try to install or uninstall a Nuget package through the package manager, it justs builds my solution showing me all of the errors I have because the package is not installed. It does nto try to install or uninstall the package. Why is it building my project instead of just installing / uninstalling the bloody package?
Why is it building my project instead of just installing /
uninstalling the bloody package?
It's not default behavior of VS IDE itself.
As for VS2017, if we install a normal package using Package Manager UI, VS will check the compatibility between the package to consume and the current project. If they're compatible, the package will be installed successfully, if not, VS will throw nuget error like NU1202 or others in ErrorList window.
But I'm sure for VS2017, installing/uninstalling won't call a build.
Possible causes of the issue and corresponding suggestions:
1.This behavior results from one third-party extension.
Reset all VS settings => disable all the third-party extensions => restart VS to check if the issue persists. If after the check you find this issue results from one extension, you need to make sure if the extension provides one option to turn on/off the auto-build. Or you may need to disable/uninstall the extension temporarily and contact the author of the extension to post the issue.
You may get more details for trouble-shooting from this similar issue.
2.Custom script(.ps1,.targets) from one specific nuget package causes this.
The authors can place powershell script and PackageID.targets in .nupkg when generating packages. Some of these scrips will execute when we install the package, others will execute when we uninstall the package. See similar issue here.
You can create a new simple console project TestProject in TestProject solution. Then right-click solution=>add=>Existing project to import a new external project. Now let's install the Newtonsoft.Json package to check if the issue disappears. If the issue disappears in new project with Newtonsoft.Json package. I think it indicates one special package you try to install/uninstall may cause the issue.
Hope all above helps and feel free to let me know if there's any update.
I was following a Lynda tutorial that was showing how to add versioning to my APIs. It told me to install the NuGet package Microsoft.AspNetCore.Mvc.Versioning. I tried that and it gave me an error because it needed Microsoft.AspNetCore.Mvc.Core. So I tried to install that package, and, again, another error because it needed another package.
So I started googling for a way to make VS 2017 pull in dependencies with NuGet installation. None of the answers that I found were helpful. I’ve tried managing as packageReference and packages.config. “Allow format selection on first package install” is unchecked. And so on.
So I decided to just power through and add all the dependencies manually. I had to install 29 packages. It took me over half an hour, not including time spent chasing the cat up and down the stairs screaming at the top of my lungs.
Is there some switch I forgot to flip, or some options I didn't add, or does Microsoft really think we might want the option to install a package without installing its dependencies?
How do I get VS 2017 to install the dependencies for packages that I am trying to install?
I have reproduced this issue on my side. This is the correct behavior for nuget. That because the package which you want to install have a indirect dependency Microsoft.AspNetCore.Authentication.Abstractions (>= 2.2.0).
Note: (Version need >= 2.2.0).
However, the default package for the .net core API project also have same indirect dependency Microsoft.AspNetCore.Authentication.Abstractions (>= 2.1.1 && < 2.2.0) with version limit (>= 2.1.1 && < 2.2.0).
Note: version limit (>= 2.1.1 && < 2.2.0).
It conflict with dependency of package Microsoft.AspNetCore.Mvc.Versioning. That the reason why nuget not install the dependencies for package.
To resolve this issue, we just need to update the target framework (Right click project->Properties->Target Framework) from .NET Core 2.1 to .NET Core 2.2 for your .net core API project.
If you do not have the version 2.2.0, please download it from here and install it:
.NET SDKs for Visual Studio
After update the target framework to 2.2, the default package Microsoft.AspNetCore.App will be update to Microsoft.AspNetCore.App 2.2.0, which dependency update to Microsoft.AspNetCore.Authentication.Abstractions(>= 2.2.0 && < 2.3.0). So it compatible with the dependencies of the package Microsoft.AspNetCore.Mvc.Versioning 3.1.1.
Now I can install the package Microsoft.AspNetCore.Mvc.Versioning 3.1.1 with its dependency.
Hope this helps.
I'm trying to install some Package on Visual Studio 2017 using NuGet, I need the Microsoft.EntityFrameworkCore package but when I try to install, it fails because of a long path/repertory name. This path is supposed to be shorter than 260 chars (or 248 if it's a repertory name), but I can't figure out which path/repertory they're talking about (there is no more info in the error). So I did look to my C# project Path and this one is only 130 chars.
Do you have any solution ? I'm on a school project and I really need these packages , hope you guys can help me.
Nuget install faill because of a path which is to long
When we install the nuget package via NuGet to our project, NuGet will download the package from the nuget source and save it in the local cache.
For .net framework project, NuGet will save the package in the \packages folder in the solution folder by default. In this case, if we have the long file name issue, we could move the solution to the root of C disk, just like magicandre1981 said.
Besides, if you are interested in nuget, we could overwrite the repositoryPath value in the nuget.config file to change the default path of \packages folder.
Check details from this thread and the document.
For .net core/standard project, NuGet will save the package in the global folder C:\Users\<UserName>\.nuget\packages. In this case, if we have long username, we may get this issue, to resolve it, we could rename our username or we could change the default global package folder.
Check this thread for details.
Hope this helps.
Visual Studio 2017 - Saying "Package restore failed" while updating the NuGet packages as following:
Issue with updating NuGet packages (VS2017)
To resolve this issue, first, you should make sure your Target Framework that is used to compile your android application, Use Latest Platform (Android 8.1 (Oreo)).
Check source: Understanding Android API Levels
Second, if you confirm your Target Framework is Android 8.1 (Oreo), then Select all packages checkbox, and click Update button:
After that, all nuget packages can be updated to latest version.
The reason for this issue:
To find the reason for this issue, change the MSBuild build log to Detailed, Tools->Options->Projects and Solutions->Build and Run->MSBuild project build output verbosity:Detailed.
When you update one of those default nuget packages, in the output you will get following dependencies conflict errors:
NU1107: Version conflict detected for Xamarin.Android.Support.Compat.
Reference the package directly from the project to resolve this issue.
App1.Android -> Xamarin.Android.Support.Design 27.0.2 ->
c (= 27.0.2) App1.Android ->
Xamarin.Android.Support.v7.AppCompat 25.4.0.2 ->
Xamarin.Android.Support.Compat (= 25.4.0.2).
That means when you update the default package Xamarin.Android.Support.Design to 27.0.2, one of its dependencies, Xamarin.Android.Support.Compat also need to be updated to 27.0.2. However, other nuget package Xamarin.Android.Support.v7.AppCompat 25.4.0.2 still reference the Xamarin.Android.Support.Compat with the old version 25.4.0.2. So you will get that error.
To resolve this error, you should update all default package at once instead of one of them.
I'm new to the Nuget package manager (Maven guy normally, trying to fix a project my boss set up). Our project requires boost and openssl. Currently someone has to have boost and openssl installed on their system. I am hoping to use nuget to install the dependencies so that we can just clone-and-build anywhere that has VS2015.
But I can't make it work. Even installing the Boost headers and boost-vc140 packages, my project is still reporting Cannot open include file: 'boost/noncopyable.hpp': No such file or directory with the include #include <boost/noncopyable.hpp>.
I've tried upgrading to the newest version of nuget (the previous one ships with VS2015), I've installed all the boost nuget libraries, and just generally beat my head against this for the last day. This seems way more difficult than it should be to add dependencies to a project.
I also have no idea what openssl project to select.
Can someone please let me know what I'm doing wrong?