2012-05-02 43 views
0

我已將EF 4.0中的項目更新到EF 4.3.1。 然而,當我創建一個新的上下文對象,拋出一個異常:Entity Framework上的Cultute錯誤4.3.1

Culture is not supported. 
Parameter name: name 
2.3.2 is an invalid culture identifier. 

完整的堆棧跟蹤:

at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) 
at System.Globalization.CultureInfo..ctor(String name) 
at System.Reflection.AssemblyName.nInit(RuntimeAssembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent) 
at System.Reflection.AssemblyName..ctor(String assemblyName) 
at System.Data.Metadata.Edm.MetadataAssemblyHelper.ComputeShouldFilterAssembly(Assembly assembly) 
at System.Data.Common.Utils.Memoizer`2.<>c__DisplayClass2.<Evaluate>b__0() 
at System.Data.Common.Utils.Memoizer`2.Result.GetValue() 
at System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg) 
at System.Data.Metadata.Edm.DefaultAssemblyResolver.<GetAlreadyLoadedNonSystemAssemblies>b__0(Assembly a) 
at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext() 
at System.Data.Metadata.Edm.DefaultAssemblyResolver.GetAllDiscoverableAssemblies() 
at System.Data.Metadata.Edm.DefaultAssemblyResolver.GetWildcardAssemblies() 
at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) 
at System.Data.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) 
at System.Data.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver) 
at System.Data.Metadata.Edm.MetadataCache.SplitPaths(String paths) 
at System.Data.Common.Utils.Memoizer`2.<>c__DisplayClass2.<Evaluate>b__0() 
at System.Data.Common.Utils.Memoizer`2.Result.GetValue() 
at System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg) 
at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections) 
at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection() 
at System.Data.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor) 
at System.Data.Objects.ObjectContext..ctor(String connectionString, String defaultContainerName) 
at Stoque.ECM.Modelo.Contexto..ctor() in D:\ECM 2.0\Stoque.ECM\Stoque.ECM.Modelo\Stoque.Modelo.Designer.cs:line 159 
at Stoque.ECM.Servico.ServicoECM.ObterUsuarioPorLogin(String login) in D:\ECM 2.0\Stoque.ECM\Stoque.ECM.Servico\Classes\Usuarios.cs:line 331 

我沒有這個問題的想法...

我會很樂意提供任何幫助。

在此先感謝

+0

看起來你的裝配文化是不正確的。這是一個Web應用程序或桌面應用程序? – Pawel

+0

太棒了@Pawel!正確! lib Lucene.Net.Analyzers是這個問題。我從項目中獲得了lib,它工作。我建議你創建一個答案,以便我可以批准它。謝謝。 –

回答

1

看起來像你的一個組件的文化是不正確的。出於性能原因,默認情況下,Entity Framework會過濾出最可能沒有實體的組件,這些實體如屬於.NET Framework的組件或由Microsoft提供的程序集。實體框架使用公鑰標記來過濾這些組件。獲取公鑰標記的AssemblyName對象是使用assembly.FullName創建的。如果assembly.FullName不是有效的程序集名稱,您將看到上述異常。

+0

謝謝@Pawel! –