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

The error message is too vague #2830

Open
doggy8088 opened this issue Jun 26, 2024 · 0 comments
Open

The error message is too vague #2830

doggy8088 opened this issue Jun 26, 2024 · 0 comments

Comments

@doggy8088
Copy link

File a bug

Remember:

  • Please check that the documentation does not explain the behavior you are seeing.
  • Please search in both open and closed issues to check that your bug has not already been filed.

Include your code

I can reproduce the issue every time. Just clone my code: https://github.com/doggy8088/VS2022ScaffoldingBug

Here are the steps to reproduce the issue:

  1. Open Solution Explorer, Right-click on the Controllers folder, then Add > Controller.

  2. Choose the item template: MVC Controller with views, using Entity Framework

    Model class: Course

    DbContext class: ContosoUniversityContext

    Hit Add button.

  3. Then you will see the following error:

    There was an error running the selected code generator: 'Exception of type 'System.InvalidOperationException' was thrown.'

    image

The error message is really too vague. I took 2 hours to figure it out the root cause. I think the error message can be improved.

I also reported this issue there for VS2022: https://developercommunity.visualstudio.com/t/I-wish-there-is-a-feature-that-can-save/10691680?port=1025&fsid=ce2921a1-dd02-402d-8377-b214f05199a5

Include stack traces

N/A

Include provider and version information

Microsoft.VisualStudio.Web.CodeGeneration.Design version: 8.0.2
Target framework: .NET 8.0
Operating system: Microsoft Windows [Version 10.0.19045.4412]
IDE: Visual Studio 2022 17.10.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant