-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Throw error for unsupported scenarios in dotnet-ef #5312
Conversation
cc @divega |
LGTM. I think @rowanmiller should review the message and provide the forward link. |
@divega I've updated this PR to include the removal of "--startup-project". 😢 |
if (IsDotNetProject $fallbackProject) { | ||
# this means users specified -StartupProject explicitly | ||
# otherwise, ignore what VS has marked as the "startup project" | ||
Write-Warning "'-StartupProject' is not supported on .NET Core projects. This parameter will be ignored." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not supported in .NET Core projects or in project.json based projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. It's all "xproj" type projects.
I had a question about an error message in the PowerShell commands but everything else LGTM. |
Also added a fix for #4832 because this is going to be encountered much more now. |
{ | ||
// TODO | ||
var fwlink = ""; | ||
Reporter.Error.WriteLine($"This version of Entity Framework tools for .NET Core CLI does not support class library projects. See {fwlink} for more details."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://go.microsoft.com/fwlink/?LinkId=798221
Here is my suggestion for the message...
This preview of Entity Framework tools does not support targeting class library projects in ASP.NET Core and .NET Core applications. See {fwlink} for details and workarounds.
96222db
to
33e3c84
Compare
Updated with PR feedback. |
@@ -237,4 +237,7 @@ Change your target project to the migrations project by using the Package Manage | |||
<data name="ForceRemoveMigration" xml:space="preserve"> | |||
<value>Removing migration '{name}' without checking the database. If this migration has been applied to the database, you will need to manually reverse the changes it made.</value> | |||
</data> | |||
<data name="NoParameterlessConstructor" xml:space="preserve"> | |||
<value>No parameterless constructor on type '{contextType}' was available. Either add one to '{contextType}' or add an implementation of 'IDbContextFactory<{contextType}>'.</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rowanmiller new exception message if I am not mistaken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor changes....
No parameterless constructor was found on '{contextType}'. Either add a parameterless constructor to '{contextType}' or add an implementation of 'IDbContextFactory<{contextType}>' in the same assembly as '{contextType}'.
with any necessary changes to exceptions. |
…rs when dotnet-ef fails on a class library project Add warning in powershell that -StartupProject is going to be ignored
with exception message updates |
33e3c84
to
9ddc42d
Compare
Point users to a webpage with dotnet-ef RC2 limitations when:
Fix #5321