Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Commands: PMC invokes scaffolding with incorrect arguments #5260

Closed
natemcmaster opened this issue May 3, 2016 · 1 comment
Closed

Comments

@natemcmaster
Copy link
Contributor

When invoking Scaffold-DbContext on a .NET Core project, the powershell generates an incorrect argument list.

Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=northwind;Integrated security=true" Microsoft.EntityFrameworkCore.SqlServer -Verbose -DataAnnotations
Working directory: C:\Users\namc\Documents\Visual Studio 2015\Projects\ConsoleApplication1\ConsoleApp1
Executing command: dotnet ef --verbose --configuration Debug --build-base-path .\bin\ dbcontext scaffold 'Server=(localdb)\mssqllocaldb;Database=northwind;Integrated security=true' Microsoft.EntityFrameworkCore.SqlServer - - d a t a - a n n o t a t i o n s
Microsoft.Extensions.CommandLineUtils.CommandParsingException: Unrecognized option '-'    at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.HandleUnexpectedArg(CommandLineApplication command, String[] args, Int32 index, String argTypeName) 
    at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) 
    at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args) 
 Unrecognized option '-' 

Somehow, the powershell is adding a space between every letter of --data-annotations

https://github.com/aspnet/EntityFramework/blob/3f67cf09cc66919c9ba3d9295965fa8ad12f98da/src/Microsoft.EntityFrameworkCore.Tools/tools/EntityFramework.psm1#L474-L488

@deshazer72
Copy link

hey I get this when trying to scaffold my db

Scaffold-DbContext "Server=www.bcsfirst.com,1433;Initial Catalog=Scada;Persist Security Info=False;User ID=myid;Password=mypassword;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;" Microsoft.EntityFrameworkCore.SqlServer -Outputdir Models
Unrecognized option '--build-base-path'

I cant seem to fix it

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants