AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Sqlite package reference missed

Open simutaroman opened this issue 8 years ago • 10 comments

Hi. Please, add <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.1.2"/> to the project file. Otherwise, you'll get error with UseSqlite() in the: services.AddDbContext<MvcMovieContext>(options => options.UseSqlite("Data Source=MvcMovie.db"));


Document Details

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

simutaroman avatar Aug 28 '18 11:08 simutaroman

@simutaroman thanks. We hope to get this updated in the next couple of months - hopefully sooner.

Rick-Anderson avatar Aug 28 '18 19:08 Rick-Anderson

image

This worked for me

JesseAReyes1996 avatar Sep 08 '18 02:09 JesseAReyes1996

Not for me.

C:\Projects\CallForHelp\CallForHelp.csproj : warning NU1604: Project dependency Microsoft.EntityFrameworkCore.Sqlite does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. C:\Projects\CallForHelp\CallForHelp.csproj : warning NU1701: Package 'SQLite.Native 3.12.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project. C:\Projects\CallForHelp\CallForHelp.csproj : warning NU1604: Project dependency Microsoft.EntityFrameworkCore.Sqlite does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results. C:\Projects\CallForHelp\CallForHelp.csproj : warning NU1701: Package 'SQLite.Native 3.12.2' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project. Startup.cs(12,37): error CS0234: The type or namespace name 'Sqlite' does not exist in the namespace 'Microsoft.EntityFrameworkCore' (are you missing an assembly reference?) [C:\Projects\CallForHelp\CallForHelp.csproj] Startup.cs(13,37): error CS0234: The type or namespace name 'Sqlite' does not exist in the namespace 'Microsoft.EntityFrameworkCore' (are you missing an assembly reference?) [C:\Projects\CallForHelp\CallForHelp.csproj] 4 Warning(s) 2 Error(s)

dviljoen avatar Sep 18 '18 00:09 dviljoen

@dviljoen why are you targeting the .NET Framework rather than .NET Core? Do you have the lastest .NET Core SDK installed?

Rick-Anderson avatar Sep 18 '18 02:09 Rick-Anderson

Installed it two days ago. It is the latest.

dviljoen avatar Sep 18 '18 12:09 dviljoen

And I’m not targeting DOT NET Framework. That’s what it’s doing on its own.

dviljoen avatar Sep 18 '18 12:09 dviljoen

My .csproj file looks exactly like the one above.

dviljoen avatar Sep 18 '18 12:09 dviljoen

Getting an error during Scaffold the MovieController: dotnet aspnet-codegenerator controller -name MoviesController -m Movie -dc MvcMovieContext --relativeFolderPath Controllers --useDefaultLayout --referenceScriptLibraries

System.ArgumentException: '' is not a valid version string. at NuGet.Versioning.VersionRange.Parse(String value, Boolean allowFloating) at NuGet.Versioning.VersionRange.Parse(String value) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.GetToolLockFilePath(SingleProjectInfo toolLibrary, NuGetFramework framework, String nugetPackagesRoot) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.TryGetToolLockFile(SingleProjectInfo toolLibrary, NuGetFrameworkframework, String nugetPackagesRoot, LockFile& lockFile) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.GetToolLockFile(SingleProjectInfo toolLibrary, NuGetFramework framework, IEnumerable1 possibleNugetPackagesRoot) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.ResolveCommandSpecFromToolLibrary(SingleProjectInfo toolLibraryRange, String commandName, IEnumerable1 args, IProject project) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.ResolveCommandSpecFromAllToolLibraries(IEnumerable1 toolsLibraries, String commandName, IEnumerable1 args, IProject project) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.ResolveFromProjectTools(CommandResolverArguments commandResolverArguments) at Microsoft.DotNet.Cli.Utils.ProjectToolsCommandResolver.Resolve(CommandResolverArguments commandResolverArguments) at Microsoft.DotNet.Cli.Utils.CompositeCommandResolver.Resolve(CommandResolverArguments commandResolverArguments) at Microsoft.DotNet.Cli.Utils.CommandResolver.TryResolveCommandSpec(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName) at Microsoft.DotNet.Cli.Utils.Command.Create(ICommandResolverPolicy commandResolverPolicy, String commandName, IEnumerable1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName) at Microsoft.DotNet.Cli.Utils.Command.Create(String commandName, IEnumerable`1 args, NuGetFramework framework, String configuration, String outputPath, String applicationName) at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient) at Microsoft.DotNet.Cli.Program.Main(String[] args)

fonzi956 avatar Oct 15 '18 17:10 fonzi956

Nevermind I got it

https://github.com/aspnet/Docs/issues/6430

netcoreapp2.1

fonzi956 avatar Oct 15 '18 17:10 fonzi956

Fixed in unified version

Rick-Anderson avatar Jan 23 '19 02:01 Rick-Anderson