Error generating Controller MVC 5

Asked

Viewed 430 times

0

Good morning colleagues, I am trying to generate a controller on MVC 5 with VS 2019 and am taking the following error message.

Someone could help me with this problem?

Tela para gerar o controlador

Error executing selected code generator: 'Value -1 is out of the acceptable range of [0.2147483647]. Parameter name: value'

Mensagem de erro

  • Try placing with Layout checkbox unchecked.

  • Your project has some build error?

  • George, there’s no mistake...

  • If you try to generate for other models of the right?

  • Paulo, I cleared all checkboxes and still the problem continues.

  • George, it happens to all models..

  • 1

    The error you are experiencing has also been reported here: https://answall.com/questions/401867/erro-ao-gerar-controle-no-asp-net-mvc?noredirect=1#comment788631_401867 It seems to be a problem in version 16.2 of VS 2019: https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html But this seems to have been corrected in version 16.2.1: https://docs.microsoft.com/pt-br/visualstudio/releases/2019/release-#-visual-studio-notes2019-vers%C3%A3o-1621-visual-studio-2019-version-1621- The VS you are using is already in version 16.2.1?

  • my version is 16.2.0 I will try to update here...

  • Raquel, that’s right...

Show 4 more comments

1 answer

0

This mistake has already occurred in the company where I work, and we came to the conclusion that the problem is in visual studio.

But since this way of generating the controller is very simple, we create normal classes and only modify to be a controller.

If you work with View, and you make the same mistake, you can also do the same thing, but when you create the class, create the view with . cshtml, because by default it creates with . Cs, and at the time the file is open, it will not have the proper formatting (the one that differentiates the colors of @Html ...)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.