Entity framework EF poertools beta 2-预生成视图数据部署错误

Entity framework EF poertools beta 2-预生成视图数据部署错误,entity-framework,entity-framework-4,ef-code-first,Entity Framework,Entity Framework 4,Ef Code First,我们使用EF powertools beta 2和反向工程代码优先功能来生成我们的e 实体、上下文和视图。 我们有一个奇怪的行为,在几个机器上的团队中,生成的编译视图的哈希是不同的,然后在TFS team build上和在其他机器上一样,我们得到如下异常 问题是基于什么样的电动工具为编译后的视图生成哈希?我们可以改变的是,我们正在使用power tools beta 2和EF 4.3.1、system.data.v4.0.30319,与使用devart Oracle驱动程序的Oracle db进

我们使用EF powertools beta 2和反向工程代码优先功能来生成我们的e 实体、上下文和视图。 我们有一个奇怪的行为,在几个机器上的团队中,生成的编译视图的哈希是不同的,然后在TFS team build上和在其他机器上一样,我们得到如下异常

问题是基于什么样的电动工具为编译后的视图生成哈希?我们可以改变的是,我们正在使用power tools beta 2和EF 4.3.1、system.data.v4.0.30319,与使用devart Oracle驱动程序的Oracle db进行对比

上下文生成视图

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.551
//
//     Changes to this file may cause incorrect behavior and will be lost if  the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

[assembly: System.Data.Mapping.EntityViewGenerationAttribute(typeof(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySetsC6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534))]

namespace Edm_EntityMappingGeneratedViews
{
    /// <Summary>
    /// The type contains views for EntitySets and AssociationSets that were generated at design time.
    /// </Summary>
    public sealed class ViewsForBaseEntitySetsC6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534 : System.Data.Mapping.EntityViewContainer
    {

        /// <Summary>
        /// The constructor stores the views for the extents and also the hash values generated based on the metadata and mapping closure and views.
        /// </Summary>
        public ViewsForBaseEntitySetsC6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534()
        {
            this.EdmEntityContainerName = "Context";
            this.StoreEntityContainerName = "CodeFirstDatabase";
            this.HashOverMappingClosure = "2c6bbce22db7c9c65f8a70c5a1bae1225522a2124aad50e74bdc186ce8c70508";
            this.HashOverAllExtentViews = "26cad9d7334571a0116f89413345d00ec8e031706228df6e653c7b6396c94591";
            this.ViewCount = 56;
        }

exception :
System.Data.EntityCommandCompilationException: System.Data.EntityCommandCompilationException: An error occurred while preparing the command definition. 

System.Data.MappingException: The mapping and metadata information for EntityContainer 'MyContext' no longer matches the information used to create the pre-generated views.
   at System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedAddGeneratedViewsInEntityViewContainer(MetadataWorkspace workspace, EntityViewContainer entityViewContainer, Dictionary`2 extentMappingViews)
   at System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedCollectViewsFromObjectCollection(MetadataWorkspace workspace, Dictionary`2 extentMappingViews)
   at System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedGetGeneratedViews(EntityContainer container)
   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.Mapping.StorageMappingItemCollection.ViewDictionary.GetGeneratedView(EntitySetBase extent, MetadataWorkspace workspace, StorageMappingItemCollection storageMappingItemCollection)
   at System.Data.Mapping.StorageMappingItemCollection.GetGeneratedView(EntitySetBase extent, MetadataWorkspace workspace)
   at System.Data.Metadata.Edm.MetadataWorkspace.GetGeneratedView(EntitySetBase extent)
   at System.Data.Query.PlanCompiler.PreProcessor.ExpandView(Node node, ScanTableOp scanTableOp, IsOfOp& typeFilter)
   at System.Data.Query.PlanCompiler.PreProcessor.ProcessScanTable(Node scanTableNode, ScanTableOp scanTableOp, IsOfOp& typeFilter)
   at System.Data.Query.PlanCompiler.PreProcessor.Visit(ScanTableOp op, Node n)
   at System.Data.Query.InternalTrees.ScanTableOp.Accept[TResultType](BasicOpVisitorOfT`1 v, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.VisitNode(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp op, Node n)
   at System.Data.Query.PlanCompiler.PreProcessor.Visit(ProjectOp op, Node n)
   at System.Data.Query.InternalTrees.ProjectOp.Accept[TResultType](BasicOpVisitorOfT`1 v, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.VisitNode(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp op, Node n)
   at System.Data.Query.PlanCompiler.PreProcessor.Visit(FilterOp op, Node n)
   at System.Data.Query.InternalTrees.FilterOp.Accept[TResultType](BasicOpVisitorOfT`1 v, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.VisitNode(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp op, Node n)
   at System.Data.Query.PlanCompiler.PreProcessor.Visit(ProjectOp op, Node n)
   at System.Data.Query.InternalTrees.ProjectOp.Accept[TResultType](BasicOpVisitorOfT`1 v, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.VisitNode(Node n)
   at System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfNode.VisitDefault(Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfNode.VisitPhysicalOpDefault(PhysicalOp op, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.Visit(PhysicalProjectOp op, Node n)
   at System.Data.Query.InternalTrees.PhysicalProjectOp.Accept[TResultType](BasicOpVisitorOfT`1 v, Node n)
   at System.Data.Query.InternalTrees.BasicOpVisitorOfT`1.VisitNode(Node n)
   at System.Data.Query.PlanCompiler.PreProcessor.Process()
   at System.Data.Query.PlanCompiler.PreProcessor.Process(PlanCompiler planCompilerState, StructuredTypeInfo& typeInfo)
   at System.Data.Query.PlanCompiler.PlanCompiler.Compile(List`1& providerCommands, ColumnMap& resultColumnMap, Int32& columnCount, Set`1& entitySets)
   at System.Data.Query.PlanCompiler.PlanCompiler.Compile(DbCommandTree ctree, List`1& providerCommands, ColumnMap& resultColumnMap, Int32& columnCount, Set`1& entitySets)
   at System.Data.EntityClient.EntityCommandDefinition..ctor(DbProviderFactory storeProviderFactory, DbCommandTree commandTree)
//------------------------------------------------------------------------------
// 
//这段代码是由一个工具生成的。
//运行时版本:4.0.30319.551
//
//对此文件所做的更改可能会导致不正确的行为,如果重新生成代码,这些更改将丢失。
// 
//------------------------------------------------------------------------------
[assembly:System.Data.Mapping.EntityViewGenerationAttribute(类型为(Edm_EntityMappingGeneratedViews.ViewsForBaseEntitySetsC6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534))]
命名空间Edm_EntityMappingGeneratedView
{
/// 
///该类型包含设计时生成的EntitySet和AssociationSet的视图。
/// 
用于访问实体设置C6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534的公共密封类视图:System.Data.Mapping.EntityViewContainer
{
/// 
///构造函数存储扩展数据块的视图以及基于元数据和映射闭包和视图生成的哈希值。
/// 
公众视图浏览实体设置C6473E0A11A196A36CC5839589DE2DE553F202E361016A89F2142797168B2534()
{
this.EdmEntityContainerName=“Context”;
this.StoreEntityContainerName=“CodeFirstDatabase”;
this.HashOverMappingClosure=“2c6bbce22db7c9c65f8a70c5a1bae122552a2124aad50e74bdc186ce8c70508”;
this.HashOverAllExtentViews=“26cad9d7334571a0116f89413345d00ec8e031706228df6e653c7b6396c94591”;
this.ViewCount=56;
}
例外情况:
System.Data.EntityCommand编译异常:System.Data.EntityCommand编译异常:准备命令定义时出错。
System.Data.MappingException:EntityContainer“MyContext”的映射和元数据信息不再与用于创建预生成视图的信息匹配。
位于System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedDatadGeneratedViewsEntityViewContainer(MetadataWorkspace工作区,EntityViewContainer EntityViewContainer,Dictionary`2 ExtentMappingView)
位于System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedCollectViewsFromObjectCollection(MetadataWorkspace工作区,Dictionary`2 ExtentMappingView)
位于System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.SerializedGetGeneratedViews(EntityContainer容器)
在System.Data.Common.Utils.Memoizer`2.c_uudisplayClass2.b_uu0()中
在System.Data.Common.Utils.Memoizer`2.Result.GetValue()中
at System.Data.Common.Utils.Memoizer`2.Evaluate(TArg arg)
位于System.Data.Mapping.StorageMappingItemCollection.ViewDictionary.GetGeneratedView(EntitySetBase区段、MetadataWorkspace工作区、StorageMappingItemCollection StorageMappingItemCollection)
位于System.Data.Mapping.StorageMappingItemCollection.GetGeneratedView(EntitySetBase区段,MetadataWorkspace工作区)
位于System.Data.Metadata.Edm.MetadataWorkspace.GetGeneratedView(EntitySetBase范围)
位于System.Data.Query.PlanCompiler.PreProcessor.ExpandView(节点节点、ScanTableOp、ScanTableOp和类型过滤器)
位于System.Data.Query.PlanCompiler.PreProcessor.ProcessScanTable(节点scanTableNode、ScanTableOp、ScanTableOp和typeFilter)
在System.Data.Query.PlanCompiler.PreProcessor.Visit(ScanTableOp,节点n)中
在System.Data.Query.InternalTrees.ScanTableOp.Accept[TResultType](BasicopVisitorSoft`1V,节点n)
位于System.Data.Query.InternalTrees.BasicopVisitorSoft`1.VisitNode(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp-op,节点n)
在System.Data.Query.PlanCompiler.PreProcessor.Visite(ProjectOp,节点n)中
在System.Data.Query.InternalTrees.ProjectOp.Accept[TResultType](basicopvisitorfort`1v,节点n)
位于System.Data.Query.InternalTrees.BasicopVisitorSoft`1.VisitNode(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp-op,节点n)
在System.Data.Query.PlanCompiler.PreProcessor.Visite(FilterOp op,节点n)中
在System.Data.Query.InternalTrees.FilterOp.Accept[TResultType](BasicopVisitorSoft`1 v,节点n)处
位于System.Data.Query.InternalTrees.BasicopVisitorSoft`1.VisitNode(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitRelOpDefault(RelOp-op,节点n)
在System.Data.Query.PlanCompiler.PreProcessor.Visite(ProjectOp,节点n)中
在System.Data.Query.InternalTrees.ProjectOp.Accept[TResultType](basicopvisitorfort`1v,节点n)
位于System.Data.Query.InternalTrees.BasicopVisitorSoft`1.VisitNode(节点n)
位于System.Data.Query.PlanCompiler.SubqueryTrackingVisitor.VisitChildren(节点n)
位于System.Data.Query.InternalTrees.BasicOpVisitorOfNode.VisitDefault(节点n)
位于System.Data.Query.InternalTrees.BasicOpVisitorOfNode.VisitpPhysicalOpdefault(PhysicalOp,节点n)
位于System.Data.Query.InternalTrees.BasicopVisitorSoft`1.Visit(PhysicalProjectOp,节点n)
在System.Data.Query.InternalTrees.PhysicalProjectOp.Accept[TResultType](basicopvisitorfort`1v,节点n)
在系统中。