1

I am trying to create a Web API controller, but it somehow always throws the following error:

There was an error running the selected code generator: The value -1 is outside the acceptable range of [02147483647]. Parameter name Value

I have removed the extra NuGet packages I added, like Cors, Owin, etc but it is still throwing that error

1
  • Exactly how are you trying to create the controller, and where does this error show? It sounds somehow like there is some error in a file behind that VS uses to help you create the controller (the created controller would be a .cs-file, you can create it manually if you want to and add controller definition inside yourself). Commented Aug 23, 2019 at 16:15

2 Answers 2

1

I too got the same error while auto generating API controller code.

Since I was just messing around with a practice project, I just took the liberty to upgraded my project to the latest ASP.NET Core version along with the NuGet packages required by the code generating tool

  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.SqlServer
  • Microsoft.EntityFrameworkCore.Tools

After the updates The Code generation tool worked properly.

Sign up to request clarification or add additional context in comments.

Comments

0

Try creating the Web Api via 'Web API Controller Class (v2.1).. this works for me..

Looks like an update problem with VS2019

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.