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

Reverse-Engineer: Scaffold-DbContext not working on ASP.NET Core project #5614

Closed
saf-itpro opened this issue Jun 1, 2016 · 4 comments
Closed

Comments

@saf-itpro
Copy link

saf-itpro commented Jun 1, 2016

When using win 7 with VS2015 latest update 2 I'm getting the following issue on: Reverse Engineering Your Model. I've completed all the previous steps successfully in the above article:

I use the following command to run
PM> Scaffold-DbContext "'Server=MyMachine\SQL2012;Database=MyDbName;Trusted_Connection=True;''" Microsoft.EntityFrameworkCore.SqlServer

I get the following error:
**At line:1 char:75

  • & '' ef --configuration Debug --build-base-path .\bin\ dbcontext scaffold 'Serve ...
  • The string is missing the terminator: '.**
    
    

What am I missing?

@lajones
Copy link
Contributor

lajones commented Jun 1, 2016

Offhand it looks as though you have a double-quote and a single-quote at the start of the connection string, but 2 double-quotes at the end. If that doesn't solve the problem can you add this to #5376 please? Closing this as a dupe.

@lajones lajones closed this as completed Jun 1, 2016
@saf-itpro
Copy link
Author

saf-itpro commented Jun 1, 2016

The 2 double-quotes at the end are actually two single quotes and a double quotes copied from the original article Reverse Engineering Your Model. I thought there should be one single quote at the end instead. So, I removed one single quote and got the following error: The expression after '&' in a pipeline element produced a object that was not valid. It must result in a command name, script block or CommandInfo object.

Question: How do I move my original post above to #5376 as you advised?

@lajones
Copy link
Contributor

lajones commented Jun 1, 2016

Re your question - just add a comment describing the above in #5376.

I see the error in Reverse Engineering Your Model - I'll get that updated - it should have a double-quote followed by a single-quote at the beginning and a single-quote followed by a double-quote at the end.

To get the rest working try adding the -Verbose flag to the command. That will print out for you the actual command that is being sent. If you can then include that in #5376 that will help us track down the problem with your particular connection string and we may be able to suggest a workaround while we work on a permanent fix.

@saf-itpro
Copy link
Author

I added -Verbose flag to the command and I got the following command text to be printed out. I am including this in #5376:
Executing command: dotnet ef --configuration Debug --build-base-path .\bin\ dbcontext scaffold 'Server=MyServer\SQL2012;Database=MyDbName;Trusted_Connection=True;' Microsoft.EntityFrameworkCore.SqlServer --verbose

The error now I'm getting is same as above: The expression after '&' in a pipeline element produced a object that was not valid. It must result in a command name, script block or CommandInfo object.

@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