-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Bug creating scaffolding in VS 2022 #26592
Comments
@hcprobst, it sounds like either one of the packages that are required are not there, the wrong version or you might have an outdated global tool that you have to actually remove, before updating. Try the following: Verify the tool versions you have by running the following at the command line: You should see the following result with this version or higher (this tutorial does not use preview versions such as for 7.0): Before installing the latest of the dotnet tool dotnet-ef you need to first uninstall it: Verify your list of installed packages and their version for your MvcMovie project, at the project directory, with the following command: It is possible you might need to start over with a new project in the tutorial since we don't know what state it is in, but try what I suggested above first. Another possibility is that when running the commands to install packages at the command line, if you paste in several commands to install at once and hit return, you can still need to hit return one more time for the very last line to run, otherwise you are missing that last package. It is easy to miss. I will close this issue. For more troubleshooting you can try the community at stackoverflow.com. Feel free to reopen this issue if you have more information and feel there is a change that needs to occur in the doc instead. Thanks very much for your feedback. Always appreciated. |
I updated the instruction above with version information. |
I added the packages as you said and still get the same error, object not found. There is definitely an issue with the documentation in that it doesn't say anything about adding the codegenerator or ef packages. Now I wonder if I may be missing other packages. I have PM> dotnet list TuitionWaiver.csproj package --verbosity d
I continue to get the error message Finding the generator 'controller'... I get this when I try to build at the command line PM> dotnet build TuitionWaiver.csconfig scaffold MSBUILD : error MSB1008: Only one project can be specified. For switch syntax, type "MSBuild -help" MSBUILD : error MSB1009: Project file does not exist. |
[Enter feedback here]
Whenever I try to add a scaffold to my controllers I get an error message and am unable to add the needed items
Finding the generator 'controller'...
Running the generator 'controller'...
Minimal hosting scenario!
Generating a new DbContext class 'TuitionWaiver.Data.TuitionWaiverContext'
Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
I had the same issues trying to do this in the RazorPagesMovie60 tutorial.
I need this to work please
Suggestions?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: