Nuget packages failing to install/uninstall re:supportedFrameworks

Topics: Ecosystem
Jan 29, 2014 at 7:31 PM
Edited Jan 29, 2014 at 11:06 PM
The error message:
Error: Specified argument was out of the range of valid values.
Parameter name: supportedFrameworks

Certain packages won't install or uninstall, giving the error message above. For example, Newtonsoft.Json was installed by default for a new web app, but if I try to remove it I get the same error as when I try to install it to a project that did not have it previously. Another package that exhibits this behavior is autofac.

Last week I installed VS2013 (where I had previously been working with 2012) which might be related. I've installed the latest updates for nuget (v2.7.41101.371) and VS2013 (update 1) and I've cleared the package cache. Still no luck.

Another team member has also updated to 2013 and can install packages without issue.

Any idea what else I can do?

--edit--
Here's the stack trace:

PM> $error[0].Exception.StackTrace
at NuGet.NetPortableProfile..ctor(String version, String name, IEnumerable1 supportedFrameworks, IEnumerable1 optionalFrameworks)
at NuGet.NetPortableProfileTable.LoadPortableProfile(String version, String profileName, IFileSystem fileSystem, IEnumerable1 frameworkFiles)
at NuGet.NetPortableProfileTable.LoadPortableProfile(String version, String profileDirectory)
at NuGet.NetPortableProfileTable.<>c__DisplayClassa.<LoadProfilesFromFramework>b__6(String profileDir)
at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at NuGet.CollectionExtensions.AddRange[T](ICollection
1 collection, IEnumerable1 items)
at NuGet.NetPortableProfileTable.BuildPortableProfileCollection()
at NuGet.NetPortableProfileTable.get_Profiles()
at NuGet.NetPortableProfileTable.GetProfile(String profileName)
at NuGet.NetPortableProfile.Parse(String profileValue, Boolean treatOptionalFrameworksAsSupportedFrameworks)
at NuGet.VersionUtility.IsPortableLibraryCompatible(FrameworkName projectFrameworkName, FrameworkName packageTargetFrameworkName)
at NuGet.VersionUtility.IsCompatible(FrameworkName projectFrameworkName, FrameworkName packageTargetFrameworkName)
at NuGet.VersionUtility.<>c__DisplayClass17
1.<TryGetCompatibleItems>b__11(IGrouping2 g)
at System.Linq.Enumerable.WhereListIterator
1.MoveNext()
at System.Linq.Buffer1..ctor(IEnumerable1 source)
at System.Linq.OrderedEnumerable1.<GetEnumerator>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source)
at NuGet.VersionUtility.TryGetCompatibleItems[T](FrameworkName projectFramework, IEnumerable1 items, IEnumerable1& compatibleItems)
at NuGet.ProjectManager.GetCompatibleInstalledItemsForPackage[T](String packageId, IEnumerable1 items)
at NuGet.ProjectManager.GetFilteredAssembliesToDelete(IPackage package)
at NuGet.ProjectManager.<RemovePackageReferenceFromProject>b__9(IPackage p)
at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__313.MoveNext()
at System.Linq.Enumerable.<ExceptIterator>d__99
1.MoveNext()
at NuGet.ProjectManager.RemovePackageReferenceFromProject(IPackage package)
at NuGet.ProjectManager.Execute(PackageOperation operation)
at NuGet.ProjectManager.Execute(IPackage package, IPackageOperationResolver resolver)
at NuGet.ProjectManager.AddPackageReference(IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
at NuGet.VisualStudio.VsPackageManager.<>c__DisplayClass55.<AddPackageReference>b__54()
at NuGet.VisualStudio.VsPackageManager.RunProjectAction(IProjectManager projectManager, Action action)
at NuGet.VisualStudio.VsPackageManager.AddPackageReference(IProjectManager projectManager, IPackage package, Boolean ignoreDependencies, Boolean allowPrereleaseVersions)
at NuGet.VisualStudio.VsPackageManager.<>c__DisplayClass8.<InstallPackage>b__4()
at NuGet.VisualStudio.VsPackageManager.RunSolutionAction(Action action)
at NuGet.VisualStudio.VsPackageManager.InstallPackage(IProjectManager projectManager, String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions, Boolean skipAssemblyReferences, ILogger logger)
at NuGet.VisualStudio.VsPackageManager.InstallPackage(IProjectManager projectManager, String packageId, SemanticVersion version, Boolean ignoreDependencies, Boolean allowPrereleaseVersions, ILogger logger)
at NuGet.PowerShell.Commands.InstallPackageCommand.ProcessRecordCore()
at NuGet.PowerShell.Commands.NuGetBaseCommand.ProcessRecord()
Jan 31, 2014 at 9:50 PM
Repairing VisualStudio 2013 seems to have fixed it.