Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Entity Framework 6.3 Slow Startup

$
0
0

I have a project in ASP.NET (no ASP.NET Core, no ASP.NET MVC) based on .NET Framework 4.5 and now upgraded at Entity Framework 6.3.

I noticed that the startup time is over 1 minute.

The project have 400-500 contexts, and it is in Database First with .edmx file.

So I used Model Cache (introduced with EF 6.2)

public class EFConfiguration : DbConfiguration
{
    public EFConfiguration() : base()
    {
        string vPath = Path.GetDirectoryName(this.GetType().Assembly.Location);
        this.SetModelStore(new DefaultDbModelStore(vPath));
    }
}

[DbConfigurationType(typeof(EntityFrameworkConfiguration.EFConfiguration))]
public partial class EFEntities : DbContext
{
}

And in Web.config file

<entityFramework codeConfigurationType="EntityFrameworkConfiguration.EFConfiguration, MyProject">

The startup time remained at 1 minute, in debug with Visual Studio and published on IIS.

Did I do something wrong?


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>