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

"Done" message was shown when running dotnet ef migrations script #5012

Closed
ghost opened this issue Apr 8, 2016 · 7 comments
Closed

"Done" message was shown when running dotnet ef migrations script #5012

ghost opened this issue Apr 8, 2016 · 7 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@ghost
Copy link

ghost commented Apr 8, 2016

I'm working on ef migrations in web tool side. I use dotnet ef migrations script to generate T-SQL file of migrations. When this command is done, it will show a "Done" on screen, whose the code is from src/dotnet-ef/MigrationsScriptCommand.cs (line 74 Reporter.Error.WriteLine("Done");) . This "Done" should not be handled by "Reporter.Error".

When I run the whole thing by msbuild tasks, the "Done" will be captured by msbuild.exe and it was recognized an error message. This makes people think this command has a problem and actually it is not.

Is there an option not showing "Done" on screen or some other approach to skip "Done" ?

@natemcmaster
Copy link
Contributor

Fixed via #5020. More work on how we log needs to be done. See #4771

@smitpatel
Copy link
Contributor

I am using Entity Framework .NET Core CLI Commands 1.0.0-rc3-20747 and still hitting this issue.

dotnet : Done. To undo this action, use 'ef migrations remove'
At line:1 char:1
+ dotnet ef migrations add Init
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Done. To undo t...rations remove':String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

@smitpatel
Copy link
Contributor

not just for done for any other message also same error

dotnet : An operation was scaffolded that may result in the loss of data. Please review the migration for accuracy.
At line:1 char:1
+ dotnet ef migrations add StringLength
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (An operation wa...n for accuracy.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Done. To undo this action, use 'ef migrations remove'

@divega
Copy link
Contributor

divega commented Apr 29, 2016

Reopening for now based on @smitpatel's findings.

@divega divega reopened this Apr 29, 2016
@natemcmaster
Copy link
Contributor

Possible duplicate of #4771

@smitpatel
Copy link
Contributor

smitpatel commented May 2, 2016

I was using powershell but cli commands.

@natemcmaster
Copy link
Contributor

I've proposed 2 changes in #5542 that will help with this and related scripting errors:

  1. dotnet ef will only use stderr for actual error messages.
  2. Commands with json output --json will now also have --json-delimited. This will additionally spit out '//BEGIN' and '//END' for those so those building scripting on top of ef commands and who need to ensure they get only JSON as they parse its output.

cc @mlorbetske

@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

6 participants