2

Closed

Schema version of Microsoft.AspNet.WebPages is incompatible with NuGet

description

I'm getting an error whenever I try to load the NuGet extensions gallery from WebMatrix 3. Originally I had a problem when opening the Extensions panel in WebMatrix 3 with the NuGet extension itself. The Update function never worked, even after restarting WebMatrix 3. But I deleted the Extensions and Templates directories from both the local app data and Program x86 directories for WebMatrix 3, deleted all WebMatrix 3 cache directories, and then uninstalled and reinstalled WebMatrix 3. Now I get the error below when I try to open the NuGet packages gallery using the NuGet button in WebMatrix 3:

An error occurred.

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

System.InvalidOperationException: The schema version of 'Microsoft.AspNet.WebPages' is incompatible with version 2.5.40416.9020 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.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.OptimizedZipPackage.EnsureManifest()
at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath)
at NuGet.LocalPackageRepository.OpenPackage(String path)
at NuGet.LocalPackageRepository.GetPackage(Func2 openPackage, String path)
at NuGet.LocalPackageRepository.<>c__DisplayClass9.<FindPackage>b__5(String path)
at System.Linq.Enumerable.WhereSelectEnumerableIterator
2.MoveNext()
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable
1 source)
at NuGet.LocalPackageRepository.FindPackage(Func2 openPackage, String packageId, SemanticVersion version)
at NuGet.LocalPackageRepository.FindPackage(String packageId, SemanticVersion version)
at NuGet.PackageRepositoryExtensions.FindPackage(IPackageRepository repository, String packageId, SemanticVersion version, IPackageConstraintProvider constraintProvider, Boolean allowPrereleaseVersions, Boolean allowUnlisted)
at NuGet.DataServicePackage.EnsurePackage(IPackageCacheRepository cacheRepository)
at NuGet.DataServicePackage.GetSupportedFrameworks()
at NuGet.PackageRepositoryExtensions.<>c__DisplayClass2a.<SupportsTargetFrameworks>b__29(FrameworkName t)
at System.Linq.Enumerable.Any[TSource](IEnumerable
1 source, Func2 predicate)
at NuGet.PackageRepositoryExtensions.SupportsTargetFrameworks(IEnumerable
1 targetFramework, IPackage package)
at NuGet.PackageRepositoryExtensions.<>c__DisplayClass27.<GetUpdatesCore>b__23(IPackage candidate)
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()
at System.Collections.Generic.List
1.InsertRange(Int32 index, IEnumerable1 collection)
at NuGet.PackageRepositoryExtensions.GetUpdatesCore(IPackageRepository repository, IEnumerable
1 packages, Boolean includePrerelease, Boolean includeAllVersions, IEnumerable1 targetFramework, IEnumerable1 versionConstraints)
at NuGet.DataServicePackageRepository.GetUpdates(IEnumerable1 packages, Boolean includePrerelease, Boolean includeAllVersions, IEnumerable1 targetFrameworks, IEnumerable1 versionConstraints)
at NuGet.PackageRepositoryExtensions.GetUpdates(IPackageRepository repository, IEnumerable
1 packages, Boolean includePrerelease, Boolean includeAllVersions, IEnumerable1 targetFrameworks, IEnumerable1 versionConstraints)
at NuGet.WebMatrix.WebProjectManager.GetPackagesWithUpdates(String searchTerms, Boolean filterPreferredPackages)
at NuGet.WebMatrix.NuGetPackageManager.GetPackagesWithUpdates()
at NuGet.WebMatrix.NuGetModel.GetPackagesWithUpdates()
at NuGet.WebMatrix.FilterManager.GetUpdatePackages()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()

If I delete the AspNet.WebPages packages I then get a configuration error for the site itself since those files can not be found.

How can I fix this?
Closed Mar 13 at 9:25 PM by RanjiniM

comments

danliu wrote Mar 3 at 5:48 PM

@roschler, this is a known issue. It's basically due to that packages requires higher version of NuGet extension that what's already installed.

After you encounter this error, click OK will bring back the list of packages, where you can do package operations.

or, if you prefer, you can change the source of packages from WebMatrix package source to nuget.org. Then the error will not be shown when you first load the NuGet extension. Hope this helps.

roschler wrote Mar 4 at 12:28 PM

Thanks. Switching the source to NuGet got rid of the error. Unfortunately, when I run my WebMatrix site locally now, IIS Express isn't launched anymore so the web page can't load any of its referenced files. Do you know what I might have done during this process to cause this problem?

roschler wrote Mar 4 at 12:54 PM

Please ignore that last question. While trying to fix the problem earlier I deleted several files from the WebMatrix package dir, some of which were necessary. I have restored them and the project is fine. Thanks again.