0

I'm trying to get "EntityFramework.SQLite": "7.0.0-beta1" to work within ASP.NET 5.

I've created my project using Yeoman and installed EF sqlite from the package manager.

The project builds fine but when running I get:

Could not load file or assembly 'Microsoft.Framework.Logging.ILogger, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'or one of its dependencies.

My project.json:

"dependencies": {
    "Microsoft.AspNet.Diagnostics": "1.0.0-beta5",
    "Microsoft.AspNet.Mvc": "6.0.0-beta5",
    "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta5",
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.Kestrel": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
    "Microsoft.AspNet.StaticFiles": "1.0.0-beta5",
    "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta5",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta5",
    "Microsoft.Framework.Logging": "1.0.0-beta5",
    "Microsoft.Framework.Logging.Console": "1.0.0-beta5",
    "Kestrel": "1.0.0-beta5",
    "EntityFramework.SQLite": "7.0.0-beta1"
},

I'm suspecting a versioning issue here

Things I've tried :

Tried using beta5 for EF only to have other packages breaking. I've also changed "Microsoft.Framework.Logging": "1.0.0-beta5" to the latest and got to the point where the db created successfully but then broke when it got to services.AddMvc();

I've checked the sample project into git hub: https://github.com/roboriaan/asp567

Any help would be really appreciated. Thanks

ryan g
  • 308
  • 2
  • 12

4 Answers4

2

Here is an Example https://github.com/Schr3da/ASP.net-vnext-samples project which modifies the asp.net Mvc sample to work with Sqlite

https://github.com/Schr3da/ASP.net-vnext-samples

regards Schreda

Georg
  • 423
  • 3
  • 8
0

You can't mix beta1 and beta5 packages. Given that the SQLite provider is still a work in progress, your best option is to use the latest beta7 nightly version, that fixes a few bugs. Make sure to also update your DNX runtime using dnvm upgrade -u

You can find the latest package on MyGet: http://myget.org/gallery/aspnetvnext

Kévin Chalet
  • 39,509
  • 7
  • 121
  • 131
  • Thanks for the quick response. I've upgraded to beta7 but see the extension method for `optionsBuilder.UseSQLite` is not there anymore. That's probably being worked on? I'll keep on searching. – ryan g Jul 26 '15 at 16:30
  • It's still there, but it's named `UseSqlite`, not `UseSQLite` (different casing): https://github.com/aspnet/EntityFramework/blob/dev/src/EntityFramework.Sqlite/SqliteDbContextOptionsBuilderExtensions.cs#L14. `AddSqlite` is still there too: https://github.com/aspnet/EntityFramework/blob/dev/src/EntityFramework.Sqlite/SqliteEntityFrameworkServicesBuilderExtensions.cs#L21 – Kévin Chalet Jul 26 '15 at 16:32
  • I'm only getting UseModel. Will recheck. Thanks – ryan g Jul 26 '15 at 16:42
  • Make sure you're correctly importing the `Microsoft.Data.Entity` namespace. – Kévin Chalet Jul 26 '15 at 16:45
  • Just to make 100% sure. All my packages needs to be the same beta#. So if I go sql beta7 all my other packages must go to beta7? – ryan g Jul 26 '15 at 17:29
  • Yes, latest beta6 packages might work with early beta7, but that's definitely not a guarantee, specially since massive naming changes have been added to DNX. – Kévin Chalet Jul 26 '15 at 17:38
  • Shweet! Will keep that in mind. Will add to git as I make progress. – ryan g Jul 26 '15 at 17:41
0

Wait for beta 6, that includes proper SQLite support and samples. Beta 6 comes tomorrow! (July 27)

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
0

Now that beta 6 is out, checkout the Getting Started with ASP.NET 5 guide. This uses SQL Server. The Getting Started with OS X guide uses SQLite.

natemcmaster
  • 25,673
  • 6
  • 78
  • 100