0

.Net 4.0でEF 4.3からEF 5にアップグレードしようとしています

を使用して移行を実行すると、次のupdate-databaseようになります。

System.Data.MetadataException: Schema specified is not valid. Errors: 
(0,0) : warning 0005: Could not find schema information for the attribute 'Namespace'.
(0,0) : warning 0005: Could not find schema information for the attribute 'Provider'.
(0,0) : warning 0005: Could not find schema information for the attribute 'ProviderManifestToken'.
(0,0) : warning 0005: Could not find schema information for the attribute 'Alias'.
(0,0) : error 0010: The element Schema in namespace http://schemas.microsoft.com/ado/2009/11/edm/ssdl was unexpected for the root element. The expected Schema in one of the following namespaces: http://schemas.microsoft.com/ado/2006/04/edm/ssdl, http://schemas.microsoft.com/ado/2009/02/edm/ssdl.
   at System.Data.Metadata.Edm.StoreItemCollection.Loader.ThrowOnNonWarningErrors()
   at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths)
   at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer`2& cachedCTypeFunction)
   at System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders)
   at System.Data.Entity.Migrations.Extensions.XDocumentExtensions.GetStoreItemCollection(XDocument model, DbProviderInfo& providerInfo)
   at System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel, XDocument targetModel, String connectionString)
   at System.Data.Entity.Migrations.DbMigrator.IsModelOutOfDate(XDocument model, DbMigration lastMigration)
   at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId)
   at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration)
   at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration)
   at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore()
   at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()
Schema specified is not valid. Errors: 
(0,0) : warning 0005: Could not find schema information for the attribute 'Namespace'.
(0,0) : warning 0005: Could not find schema information for the attribute 'Provider'.
(0,0) : warning 0005: Could not find schema information for the attribute 'ProviderManifestToken'.
(0,0) : warning 0005: Could not find schema information for the attribute 'Alias'.
(0,0) : error 0010: The element Schema in namespace http://schemas.microsoft.com/ado/2009/11/edm/ssdl was unexpected for the root element. The expected Schema in one of the following namespaces: http://schemas.microsoft.com/ado/2006/04/edm/ssdl, http://schemas.microsoft.com/ado/2009/02/edm/ssdl.

.Net 4.0 を使用しているときにこれをパスする方法はありますか? EF 5 の一部の機能が .Net 4 で使用できないことはわかっています。しかし、SSD が 60GB しかなく、現在 4 GB しか空いていないため、VS2012 インストーラーが勝ったため、.Net 4.5 または VS 2012 にアップグレードできません。それをインストールさせないでください(他のドライブであっても)。

Web.config には、次のものへの参照があります。

<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
4

1 に答える 1

1

.NET Framework 4 を使用してデータベースを更新している間、データベースに格納されているモデルには v3 スキーマがあるようです。.NET Framework 4 の EF コンポーネントは v3 (v2 のみ) スキーマを認識しないため、エラーが発生します。.NET Framework 4.5 と VS2012 に移行する必要があると思います。

于 2013-01-07T21:16:01.743 に答える