Aspnetcore.docs: UseSqlite method Not Found!

Created on 30 May 2018  Â·  5Comments  Â·  Source: dotnet/AspNetCore.Docs

I follow the step but DbContextOptionsBuilder class doesn't have UseSqlite method , Then I find UseSqlite is a extension method in
SqliteDbContextOptionsBuilderExtensions
in Microsoft.EntityFrameworkCore.dll
How can I add this assembly?

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P4 Source - Docs.ms

Most helpful comment

@Rick-Anderson thank you~
err78

All 5 comments

@Rick-Anderson thank you~
err78

Using ubuntu and get this error.
jeff@jeff-ThinkPad-T420:~/dev/RazorPagesMovie$ dotnet aspnet-codegenerator razorpage -m Movie -dc MovieContext -udl -outDir Pages/Movies --referenceScriptLibraries
Building project ...
Finding the generator 'razorpage'...
Running the generator 'razorpage'...
Could not load file or assembly 'System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
RunTime 00:00:07.11

dotnet --version
2.1.300

@jtshannon

'System.Collections.Immutable, Version=1.2.3.0,

That's pretty old. What does you .csproj file look like? See the preceding post for a correct one.

I had the same issue. Tried to add the reference as @billschen said but I got an exception at the dotnet ef database update.
Found out you need the following package instead (also giving a version to prevent warnings):
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.1"/>
and not Microsoft.EntityFrameworkCore.Sqlite.Core

Was this page helpful?
0 / 5 - 0 ratings