Home: NuGet Package Manager for VS 2012 does not support .NETStandard

Created on 14 Jul 2016  路  25Comments  路  Source: NuGet/Home

Version 2.8.60318.667 of the NuGet Package Manager - which is the latest version available for Visual Studio 2012 - does not support packages that defines dependencies for .NETStandard.

When - for example - a given package defines dependencies for both UAP10.0 and .NETStandard 1.3, then the following is reported:

'_package name_' already defines a dependency for '_dependency name_'

I'm well aware that Visual Studio 2012 is pretty dated, but I lead an OSS project (SSH.NET) for which we want to support a broad set of target frameworks. This issue prevents us from having a single package for all our supported target frameworks.

An example of a .nuspec that exposes this issue is available here.

Let me know if you want me to upload a .nupkg that allows you to reproduce the error.

Most helpful comment

I fixed this issue in VS2013 with two steps:
1) Run command Install-Package Newtonsoft.Json -Version 9.0.1
2) Run command Update-Package Newtonsoft.Json
For some reason this fixed the issue.

(In Jenkins project I have to deselect the button "Delete workspace before build starts". Newtonsoft stuff from SCM messed things up.)

All 25 comments

We shipped a version of 2.12 for VS2013 with NetStandard support on June 27th.
We wanted to ship one for VS2012 as well, however we ran into some problems. You are the first person to notice.

Putting into our current milestone to help us resolve the plan.

Another option would be to release SL4, WP7 (...) framework targeting packs for VS2013 and/or VS2015 :-)

@rrelyea, there are some old milestones that need to be closed https://github.com/NuGet/Home/milestones. Such as 2.12, which is 100% done but still opened.

Is this issue indeed scheduled to be fixed in 3.5 RTM (and 2.13) ?
I'm getting reports by users of SSH.NET almost daily.

I'm one of the users still using VS2012, yes AT&T is still using it as a standard. I really need to SFTP files for a deadline fast approaching.

@kl7323: as workaround, you can download the nuget package from nuget.org, extract it and pick the assembly that you need.

This has been months since this was updated. Please release a 2012 nuget client that supports packages that contain .net standard. This is insane you are sitting on this this long when customers and end users now cannot use packages like JSON.NET

Still can't install on Visual Studio 2012! It kinda breaks the idea of nuget being the preferred deployment model for VS...

Same issue here, need to install protobuf-net.
Is there any update on this topic, or is it dead?
Thanks

What's the status on this issue?

Has anyone figured out a work around for this issue for 2012? @drieseng , you outlined some steps, but I don't have much experience with this.

There is no work around, you have to remove .net core support from your nuget package or have them manually install the package.

Just adding my voice to the crowd here, also trying to migrate library dependencies into .NET standard and facing the same issues. This will become a serious maintenance problem growing forward as everyone seems to be migrating their projects to .NET standard (understandably). Projects faced with compatibility constraints seem bound to suffer...

I am stuck on VS2010 due to a dependent on the installer. Can this please be patched and released so that VS2010 can also benefit from the VS2012 patches. I have a whole host of projects that are being maintained on VS2010 that can't be migrated but rely on nuget for new libraries including Json.net which is now broken!

2013 also does this fwiw.

PM> Install-Package Newtonsoft.Json -Version 9.0.1
Works in a pinch

This worked for me. Installed an older version:

Install-Package Newtonsoft.Json -Version 9.0.1

Oh, didn't see twobob's comment!

Note we are having this error even though we are using an older version of Newtonsoft. We are using the .NET NuGet.Core package version 2.12 to download packages manually, and even though we're asking for a specific version, it's loading the latest during scanning and then failing to open it...

The callstack looks like

[12:17:47][Exec] ERROR! System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'.
[12:17:47][Exec] at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
[12:17:47][Exec] at NuGet.Manifest.Validate(Manifest manifest)
[12:17:47][Exec] at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
[12:17:47][Exec] at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
[12:17:47][Exec] at NuGet.OptimizedZipPackage.EnsureManifest()
[12:17:47][Exec] at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath)
[12:17:47][Exec] at NuGet.LocalPackageRepository.OpenPackage(String path)
[12:17:47][Exec] at NuGet.LocalPackageRepository.GetPackage(Func2 openPackage, String path) [12:17:47][Exec] at NuGet.LocalPackageRepository.<GetPackages>d__15.MoveNext() [12:17:47][Exec] at NuGet.CollectionExtensions.AddRange[T](ICollection1 collection, IEnumerable1 items) [12:17:47][Exec] at NuGet.LocalPackageRepository.FindPackagesById(Func2 openPackage, String packageId)
[12:17:47][Exec] at NuGet.LocalPackageRepository.FindPackagesById(String packageId)
[12:17:47][Exec] at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
[12:17:47][Exec] at NuGet.LazyLocalPackageRepository.FindPackagesById(String packageId)
[12:17:47][Exec] at NuGet.PackageRepositoryExtensions.FindPackagesById(IPackageRepository repository, String packageId)
[12:17:47][Exec] at NuGet.PackageRepositoryExtensions.FindPackages(IPackageRepository repository, String packageId, IVersionSpec versionSpec, Boolean allowPrereleaseVersions, Boolean allowUnlisted)

Note we're just calling FindPackages(IPackageRepository repository, String packageId, IVersionSpec versionSpec, Boolean allowPrereleaseVersions, Boolean allowUnlisted) so we're passing in a valid range that doesn't have this problem, but it's loading the latest anyway...

I fixed this issue in VS2013 with two steps:
1) Run command Install-Package Newtonsoft.Json -Version 9.0.1
2) Run command Update-Package Newtonsoft.Json
For some reason this fixed the issue.

(In Jenkins project I have to deselect the button "Delete workspace before build starts". Newtonsoft stuff from SCM messed things up.)

I cannot even uninstall Newtonsoft.JSON through the command line. I ended opening my project in VS `15 and changing the Newtonsoft version there.

Can't wait till the day when VS is only using NPM.

Still no working version for VS2012. By now we should infer that it will never be implemented. I'll download the sources manually on github for FcmSharp :-)

I found out the same error with VS2012.
I could successfully install previous version, as @twobob , @mikenap and @HarriMaatta suggested.

@AgustinPradoDamez my problem was that I needed the latest versions of HttpClient and FcmSharp. I've downloaded VS2017 Community, used nuget inside it, then opened the solution in VS2012. This is ridiculous, but the "nuget" guys don't seem to care :-)

At this point we do not plan on releasing an update for VS2015 or earlier. Please try latest VS2017 and let us know if you need more help from us.

What if we cannot upgrade to VS2017+?
There should be at least a way to install old packages, telling us which is the most recent package that is supported by NuGet 2.8. How could we find it by our own?...
I'm very disappointed for this customer treatment!

Is there any fix done for this issue to use .Net Standard dependent packages in VS2012?
I am getting 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp'. while trying to install Swagger.

Was this page helpful?
0 / 5 - 0 ratings