Scaffold Error with API Controller with actions, using Entity Framework on .NET 9.0
When I try to add a scaffolded file that is of type API Controller with actions, using Entity Framework on .NET 9.0 I get an error of * Scaffold item command has finished with error: Unrecognized option '--useSqlite'
Here is the log rider shows me:
Start checking required NuGet packages...
Checking 'Microsoft.EntityFrameworkCore.Sqlite' NuGet Package...
Checking 'Microsoft.EntityFrameworkCore.SqlServer' NuGet Package...
Checking 'Microsoft.EntityFrameworkCore.Tools' NuGet Package...
Checking 'Microsoft.VisualStudio.Web.CodeGeneration.Design' NuGet Package...
Building project 'TodoApi'...
Check and install Code Generation tool...
Start scaffolding 'ApiControllerEntityFramework'...
Running command: /Users/[NAME]/Repos/TodoApi/obj/dotnet-aspnet-codegenerator --project /Users/[NAME]/Repos/TodoApi/TodoApi.csproj --target-framework net9.0 --configuration "Debug" --no-build controller --controllerName TodoController --relativeFolderPath "/Users/[NAME]/Repos/TodoApi/Controllers" --restWithNoViews --model TodoApi.Models.TodoItem --dataContext TodoApi.Models.TodoContext --controllerNamespace TodoApi.Controllers --useSqlite
Finding the generator 'controller'...
Running the generator 'controller'...
Specify --help for a list of available options and commands.
Unrecognized option '--useSqlite'
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.HandleUnexpectedArg(CommandLineApplication command, String[] args, Int32 index, String argTypeName, Boolean ignoreContinueAfterUnexpectedArg)
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:01.10
Scaffolding 'ApiControllerEntityFramework' has finished with errors:
* Scaffold item command has finished with error: Unrecognized option '--useSqlite'
Please sign in to leave a comment.
Hello Marios,
Thank you for contacting Rider support. Unfortunately, you encountered a known issue:
We would appreciate it if you could upvote it to demonstrate your interest;
As a workaround, you can copy the command line shown in Rider output, change
--useSqlitein the end to--databaseProvider sqliteand invoke this manually from the terminal, for ex:Hope that helps. Apologies for the inconvenience.
Have a nice day!
I’m trying that workaround, but being told I must install .NET to run this application. Which I’m pretty sure I already got.
I am glad to hear that a solution was found. Should you have any other questions or difficulties in the future, do not hesitate to contact support.
Have a nice day!