相关疑难解决方法(0)

从EF 6.0 Beta升级到RC后的System.MissingMethodException

这是什么意思?

System.MissingMethodException未由用户代码处理
HResult = -2146233069消息=未找到方法:'System.Data.Entity.ModelConfiguration.Configuration.PrimitivePropertyConfiguration System.Data.Entity.ModelConfiguration.Configuration.StructuralTypeConfiguration1.Property(System.Linq.Expressions.Expression12 <!0,!! 0 >>)".Source = Att.Uds.DataLayerMappings StackTrace:位于att.Uds.DataLayerMappings.ItemTypeItemConfiguration..ctor()at at.Uds.DataLayerMappings.UdsContext.OnModelCreating(DbModelBuilder modelBuilder)in c:\ TFS\ATS-MSDev\UDS\Dev\Code\Att.Uds.DataLayerMappings\UdsContext.cs:位于System.Data.Entity.Internal.RazyInternalContext.CreateModelBuilder()处System.Data.Entity.Internal的System.Data.Entity.DbContext.CallOnModelCreating(DbModelBuilder modelBuilder)的第163行System.Data.Entity.Internal.RetryLazy2.GetValue(TInput输入)中的.LazyInternalContext.CreateModel(LazyInternalContext internalContext)InnerException:

此类发生错误:

namespace Contoso.Fabrikam.DataLayerMappings
{ 
  public abstract class NamedEntityConfiguration<TEntity> : EntityBaseConfiguration<TEntity> where TEntity : NamedEntity
  {
    public ConfigurationColumn NameColumn;
    protected new int LastOrdinalPosition
    {
      get
      {
        return (NameColumn.Ordinal);
      }
    }
    public NamedEntityConfiguration() <=== EXCEPTION HERE
    {
      NameColumn = new ConfigurationColumn() { Ordinal = base.LastOrdinalPosition+1, Name = "Name", IsRequired = true, Length = 128 };
      this.Property(t => t.Name)
        .HasColumnName(NameColumn.Name)
        .HasColumnOrder(NameColumn.Ordinal)
        .HasMaxLength(NameColumn.Length);
      if(NameColumn.IsRequired) …
Run Code Online (Sandbox Code Playgroud)

c# entity-framework

4
推荐指数
2
解决办法
5033
查看次数

标签 统计

c# ×1

entity-framework ×1