-
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
[TINY] RevEng: Throw error if user attempts to run Scaffold-DbContext in a VB project. #4087
Conversation
@@ -409,6 +409,9 @@ function Scaffold-DbContext { | |||
$values = ProcessCommonParameters $StartupProject $Project | |||
$dteStartupProject = $values.StartupProject | |||
$dteProject = $values.Project | |||
if ([string]::Compare($dteProject.Kind.ToString(), "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}", $True) -eq 0) { | |||
throw "Project $Project is a Visual Basic project which is not yet supported by Scaffold-DbContext." | |||
} |
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.
Does this cover all VB.NET projects, or just class library?
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.
I would say all relevant project types: http://www.mztools.com/articles/2008/mz2008017.aspx
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.
In EF6, we detected using project.CodeModel.Language == CodeModelLanguageConstants.vsCMLanguageVB
. I believe this caught all projects including Web Sites.
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.
I'll test a few more project types, but the above code was taken from VsUtils
in EF6.
Why doesn't it just spit out C# code? The project models are almost identical... |
I don't like the idea of blocking users from doing this. In Migrations, they can override the |
I believe we said in the past that we wouldn't necessarily support VB, but we also wouldn't explicitly block it either. |
@bricelam As mentioned in the issue #3417 I'm happy to just leave the code as is - in which case it does successfully output C# code into the VB project. But @rowanmiller is in favor of the error message... |
Oh, right, yeah I missed that we would be blocking someone from implementing support themselves... yeah we should not block that. |
Ok, yeah... just C# is fine |
OK. I'll close this and update the issue to say we're leaving it as is. |
Fix for #3417.