locked
EF CTP 5 Incompatible with EF 4.1. RRS feed

  • Question

  • Hi,

    The project was broken.

    Don,t try it lots problem now. EF 5

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using IFSolutionFX.Data;
    using IFSolutionFX.Model;

    namespace IFSolutionFX.Sql
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("IFSolution.Design", "CA1063:ImplementIDisposableCorrectly",
            Justification = "Inherited from IDbContext interface, which exists to support using.")]
        public partial class IFSolutionFXDbContext : DbContext, IUnitOfWork
        {
            /// <summary>
            /// This method sets up the database appropriately for the available model objects.
            /// This method only sets up the data tier. 
            /// Any shared or model level requirements (data validations, etc) are on the model objects themselves.
            /// </summary>
            /// <param name="modelBuilder">The model builder object for creating the data model.</param>
            protected override void OnModelCreating(DbModelBuilder modelBuilder)
            {
                SetupArGroupCodeEntity(modelBuilder);
            }

            private void SetupArGroupCodeEntity(DbModelBuilder modelBuilder)
            {
                modelBuilder.Entity<ArGroupCode>().HasKey(a => a.ArGroupID);
                modelBuilder.Entity<ArGroupCode>().Property(a => a.ArGroupID).HasMaxLength(15);
                modelBuilder.Entity<ArGroupCode>().Property(a => a.ArGroupName).HasMaxLength(50);
            }

            /// <summary>
            /// Gets or sets the database set of allowed argroupcodes.
            /// </summary>
            /// <value>An entity set of strings</value>
            public DbSet<ArGroupCode> ArGroupCodes { get; set; }

            /// <summary>
            /// Allows saving changes via the IUnitOfWork interface.
            /// </summary>
            public new void SaveChanges()
            {
                base.SaveChanges();
            }
        }
    }

     

     

    Error 1 The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\RepositoryInitializer.cs 6 26 IFSolutionFX.FSql
    Error 2 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\DropCreateAlwaysSqlInitializer.cs 15 105 IFSolutionFX.FSql
    Error 3 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\CreateIfNotExistsSqlInitializer.cs 16 106 IFSolutionFX.FSql
    Error 4 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\DropCreateIfModelChangesSqlInitializer.cs 18 26 IFSolutionFX.FSql
    Warning 5 The referenced assembly "DotNetOpenAuth" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. IFSolutionFX.Desktop
    Warning 6 The referenced assembly "DotNetOpenAuth" could not be resolved because it has a dependency on "System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. IFSolutionFX.Desktop
    Warning 7 The referenced assembly "DotNetOpenAuth" could not be resolved because it has a dependency on "System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. IFSolutionFX.Desktop
    Warning 8 The referenced assembly "DotNetOpenAuth" could not be resolved because it has a dependency on "System.Web.Mobile, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project. IFSolutionFX.Desktop
    Error 9 Metadata file 'E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\bin\Debug\IFSolutionFX.Sql.dll' could not be found E:\FXSolution\IFSolutionFX\IFSolutionFX.Desktop\CSC IFSolutionFX.Desktop
    Error 10 The type or namespace name 'Database' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 8 26 IFSolutionFX.FSql
    Error 11 The type or namespace name 'IDatabaseInitializer' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 16 47 IFSolutionFX.FSql
    Error 12 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 16 81 IFSolutionFX.FSql
    Error 13 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 45 26 IFSolutionFX.FSql
    Error 14 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 45 57 IFSolutionFX.FSql
    Error 15 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\Initializers\SqlInitializer.cs 54 32 IFSolutionFX.FSql
    Error 16 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\IFSolutionFXDbContext.cs 12 50 IFSolutionFX.FSql
    Error 17 The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\IFSolutionFXDbContext.cs 20 49 IFSolutionFX.FSql
    Error 18 The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\IFSolutionFXDbContext.cs 25 45 IFSolutionFX.FSql
    Error 19 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?) E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\IFSolutionFXDbContext.cs 36 16 IFSolutionFX.FSql
    Error 20 'object' does not contain a definition for 'SaveChanges' E:\FXSolution\IFSolutionFX\IFSolutionFX.Sql\IFSolutionFXDbContext.cs 43 18 IFSolutionFX.FSql

    Tuesday, August 23, 2011 10:08 AM

Answers

  • Correct, EF CTP5 is not compatible with WCF RIA Services's EF 4.1 support, that was announced when they were both released.

    Tuesday, August 23, 2011 10:20 AM
  • Both EF 4.1 and EF 4.2 are supported by WCF RIA Services. It is only the CTP that has breaking changes.

    Wednesday, August 24, 2011 9:57 AM

All replies

  • Correct, EF CTP5 is not compatible with WCF RIA Services's EF 4.1 support, that was announced when they were both released.

    Tuesday, August 23, 2011 10:20 AM
  • Hi,

    Correct, EF CTP5 is not compatible with WCF RIA Services's EF 4.1 support, that was announced when they were both released.

    Shall we forgot EF 4.1? I would like to build an application with code first.

    Thanks.

    Tuesday, August 23, 2011 11:38 PM
  • Both EF 4.1 and EF 4.2 are supported by WCF RIA Services. It is only the CTP that has breaking changes.

    Wednesday, August 24, 2011 9:57 AM