私は最初にEFコードを使用してDBを作成しました。開発でうまく機能します。Windows Server 2003ボックスにコピーすると、これらのエラーが発生します(以下にリストされています)
EF 5、.NET4.0。
.net4フレームワークをアンインストールして再インストールしました。他のマシンでテストされています。
私のWindowsServer2008ボックスでは、正常に動作します。別の2003ボックスでは、そうではありません。
MVCを方程式から外すために、データベースからいくつかのデータを一覧表示する単純なコンソールアプリを作成しました。-同じエラーがあります。
マシンに.net4.5をインストールしてVS2012ですべてを作成しました。問題が発生する可能性があることを読んだので、VS2010で.net4をターゲットにしてすべてを書き直し、EF 5 /.net4dllへの参照を手動で追加しました。同じことですが、私の2台の開発マシンと2008サーバーではうまく機能しますが、2003年では機能しません。
エラー:
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.
これがスタックトレースです(これはMVCアプリです)
[MetadataException:指定されたスキーマが無効です。エラー: (0,0):警告0005:属性'Namespace'のスキーマ情報が見つかりませんでした。 (0,0):警告0005:属性'Provider'のスキーマ情報が見つかりませんでした。 (0,0):警告0005:属性'ProviderManifestToken'のスキーマ情報が見つかりませんでした。 (0,0):警告0005:属性'Alias'のスキーマ情報が見つかりませんでした。 (0,0):エラー0010:名前空間http://schemas.microsoft.com/ado/2009/11/edm/ssdlの要素スキーマがルート要素に対して予期されていませんでした。次の名前空間のいずれかで予想されるスキーマ:http://schemas.microsoft.com/ado/2006/04/edm/ssdl、http://schemas.microsoft.com/ado/2009/02/edm/ssdl。 ] System.Data.Metadata.Edm.Loader.ThrowOnNonWarningErrors()+8508793 System.Data.Metadata.Edm.Loader.LoadItems(IEnumerable`1 xmlReaders、IEnumerable`1 sourceFilePaths)+181 System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders、IEnumerable`1 filePaths、Boolean throwOnError、DbProviderManifest&providerManifest、DbProviderFactory&providerFactory、String&providerManifestToken、Memoizer`2&cachedCTypeFunction)+211 System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders)+295 System.Data.Entity.Migrations.Extensions.XDocumentExtensions.GetStoreItemCollection(XDocumentモデル、DbProviderInfo&providerInfo)+180 System.Data.Entity.Migrations.Infrastructure.EdmModelDiffer.Diff(XDocument sourceModel、XDocument targetModel、String connectionString)+48 System.Data.Entity.Internal.InternalContext.ModelMatches(XDocumentモデル)+45 System.Data.Entity.Internal.ModelCompatibilityChecker.CompatibleWithModel(InternalContext internalContext、ModelHashCalculator modelHashCalculator、Boolean throwIfNoMetadata)+65 System.Data.Entity.Internal.InternalContext.CompatibleWithModel(Boolean throwIfNoMetadata)+52 System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context)+239 System.Data.Entity.Internal.c__DisplayClass8.b__6()+19 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(アクションアクション)+72 [DataException:データベースの初期化中に例外が発生しました。詳細については、InnerExceptionを参照してください。] System.Data.Entity.Internal.InternalContext.PerformInitializationAction(アクションアクション)+117 System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()+186 System.Data.Entity.Internal.LazyInternalContext.b__4(InternalContext c)+7 System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)+118 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)+190 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()+73 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)+28 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()+56 System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()+15 System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()+40 System.Collections.Generic.List`1..ctor(IEnumerable`1コレクション)+315 System.Linq.Enumerable.ToList(IEnumerable`1 source)+58 c:\ Dev \ hbkiosk \ Kiosk \ Controllers \ KioskEventController.cs:23のKiosk.Controllers.KioskEventController.Index() lambda_method(Closure、ControllerBase、Object [])+62 System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller、Object [] parameters)+17 System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext、IDictionary`2パラメータ)+188 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext、ActionDescriptor actionDescriptor、IDictionary`2パラメータ)+27 System.Web.Mvc.Async.c__DisplayClass42.b__41()+28 System.Web.Mvc.Async.c__DisplayClass8`1.b__7(IAsyncResult _)+12 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)+29 System.Web.Mvc.Async.c__DisplayClass39.b__33()+59 System.Web.Mvc.Async.c__DisplayClass4f.b__49()+240 System.Web.Mvc.Async.c__DisplayClass37.b__36(IAsyncResult asyncResult)+12 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)+31 System.Web.Mvc.Async.c__DisplayClass2a.b__20()+23 System.Web.Mvc.Async.c__DisplayClass25.b__22(IAsyncResult asyncResult)+128 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+50 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)+26 System.Web.Mvc.c__DisplayClass1d.b__18(IAsyncResult asyncResult)+14 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar)+25 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+55 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)+41 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar)+25 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+55 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)+28 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)+10 System.Web.Mvc.c__DisplayClass8.b__3(IAsyncResult asyncResult)+28 System.Web.Mvc.Async.c__DisplayClass4.b__3(IAsyncResult ar)+25 System.Web.Mvc.Async.WrappedAsyncResult`1.End()+55 System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)+30 System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)+9 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+8836913 System.Web.HttpApplication.ExecuteStep(IExecutionStep step、Boolean&completedSynchronously)+184