pharask
pharask

Reputation: 332

Unable to create Controller or View in Asp.net mvc (C# Visual Studio)

I am working on asp.net mvc project (Programming language: C#) in Visual studio 2019(version: 16.2.2). While creating Controller or view, I am getting this error.enter image description here

Error says "There was an error running the selected code generator: the value -1 is outside the acceptable range of [0, 2147483647]. Parameter name value". I have already tried to find the solution but so far I am not able to fix it. Any help is appreciated. Thanks.

Upvotes: 1

Views: 1555

Answers (1)

Nijin P J
Nijin P J

Reputation: 1322

Try clearing the ComponentModelCache, the cache will rebuild next time VS is launched.

  • Close Visual Studio Delete everything in this folder
  • C:\Users\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  • Restart Visual Studio

14.0 is for visual studio 2015. This will work for other versions also.

Upvotes: 1

Related Questions