5

I just installed WebMatrix 3.0. When I clicked on the NuGet Extension on the ribbon to load some extensions, I get an error message that says the version of NuGret installed (2.2 apparently) is not compatible with the version of the .Net.Http dll. I've tried upgrading NuGet through the extension manager, but there doesn't seem to be a way to do that - there is only a disable and an uninstall option. Any thoughts on what's going on here? Why is an incompatible, back version of NuGet installed with WebMatrix 3.0?

Error message with stack trace follows:

An error occurred.

The schema version of 'Microsoft.Net.Http' is incompatible with version 2.2.31210.9045   of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.

System.InvalidOperationException: The schema version of 'Microsoft.Net.Http' is incompatible with version 2.2.31210.9045 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
   at NuGet.Manifest.CheckSchemaVersion(XDocument document)
   at NuGet.Manifest.ValidateManifestSchema(XDocument document, String schemaNamespace)
   at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider)
   at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
   at NuGet.ZipPackage.EnsureManifest()
   at NuGet.ZipPackage..ctor(Func`1 streamFactory, Boolean enableCaching)
   at NuGet.PackageDownloader.DownloadPackage(IHttpClient downloadClient, IPackageMetadata package)
   at NuGet.PackageDownloader.DownloadPackage(Uri uri, IPackageMetadata package)
   at NuGet.DataServicePackage.EnsurePackage(IPackageRepository cacheRepository)
   at NuGet.DataServicePackage.GetSupportedFrameworks()
   at NuGet.PackageRepositoryExtensions.<>c__DisplayClass2e.<SupportsTargetFrameworks>b__2d(FrameworkName t)
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
   at NuGet.PackageRepositoryExtensions.SupportsTargetFrameworks(IEnumerable`1 targetFramework, IPackage package)
   at NuGet.PackageRepositoryExtensions.<>c__DisplayClass2b.<GetUpdatesCore>b__26(<>f__AnonymousType19`2 <>h__TransparentIdentifier22)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.GroupedEnumerable`3.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at Microsoft.WebMatrix.NuGet.FilterManager.AddPackagesToFilter(ListViewFilter filter, IEnumerable`1 packages, PackageViewModelAction packageAction)
   at Microsoft.WebMatrix.NuGet.FilterManager.<>c__DisplayClass7.<UpdateFilterWithResult>b__6(Task`1 task)
   at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
T Driver
  • 73
  • 6

2 Answers2

2

I just encountered this same error message. The solution was to clear the NuGet package cache and try again.

More information on how to clear the NuGet package cache here.

Oran Dennison
  • 3,237
  • 1
  • 29
  • 37
  • The options for clearing the cache require you to run Visual Studio, and open the Options panel. I did that, then went back into WebMatrix 3 and found that there was a new new update to the Nuget Extension to install. I did that, restarted WebMatrix, then went into the Nuget Package Manager and tried to update the 16 packages that needed updating. This failed in the past, but this time, they all worked. Whether it was clearing the cache, finding a new version of the NuGet extension to install or both, the problem is now fixed. Thanks much! – T Driver Mar 05 '14 at 23:48
2

To solve this problem I pointed to the official https://nuget.org/api/v2 sources.

Do the following:

  1. In the Webmatrix application, click on the NuGet icon
  2. There is a field in the bottom left of the little pop-up window, currently showing "WebMatrix Package Source", click on the drop-down and Click Add Source.
  3. Enter the following: Name - NuGet Official Package Source URL - https://nuget.org/api/v2
  4. Now the field should show "NuGet Official Package Source"

This will eliminate the error.