Problem with scaffolding any controller using visual studio 2019 i get the error :
"there was an error running the selected code generator: 'The value -1 is outside the acceptable range of [0,2147483647]. Parameter name :value'"
Related links i have tried and still this issues persist
I tried the following :
1. (Error while generating view in Visual Studio 2019)
2. (Can't Add View from Controller in VS 2015 : "There was an error running the selected code generator")
The issue is now fixed with the latest release of Visual Studio 2019: version 16.2.5: https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.5
The issue would only to happen when:
So the workaround for was:
I ran into the same problem tomorrow, tried many manipulations found on different subjects, nothing worked. Finally, someone gave me a "solution" that let me continue my project, which simply is copy/paste any view...! Of course, you'll then have to hand code everything, but at least it'll let you add new views/controllers to your project. Hope this helps!
I just found how to solve it for me after attempting many things.
My solution was to:
packages
folder.
bin
and obj
folders. Next step is to navigate to your local user folder:
Ex: C:\Users\[YourUserName]\AppData\Local\Microsoft\VisualStudio
You will see folders 16.0_
or 16.0_e9eb2d6b
(Depending on your VS version). Navigate to the second folder 16.0_e9eb2d6b
and delete the ComponentModelCache
and Designer
folders.
Close web.config file in the editor
Last step is to open your solution project in VisualStudio and click on Rebuild Solution from the Build tab.
Now try to create a View in your MVC project.
I hope this helps!
Before Creating a View or Controller Make sure that your Web.config file is not open...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With