“There was an error running the selected code generator: 'The value -1 outside the acceptable range of [0,2147483647]. Parameter name :value''”

后端 未结 13 1493
小鲜肉
小鲜肉 2020-12-03 10:45

I am working on an ASP.NET MVC project and so far I had no problems with scaffolding any type of items until now.

Every time I want to create a new controller or vie

相关标签:
13条回答
  • 2020-12-03 11:26

    One of the possibility is if your web.config file is open then this error might appear. Try closing the web.config file and then add a View.

    You can also reach out to this website for more reference: Error Running the Selected Code Generate Value

    Hope this helps.

    0 讨论(0)
  • 2020-12-03 11:26

    I tried it all and finally found a solution that worked, this issue only happens when the web.config file is open in the editor. Hope this help.

    Credits : Vijay Ramakrishnan [MSFT]
    https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html

    0 讨论(0)
  • 2020-12-03 11:28

    You just need to - delete ".vs" folder from your solution directory. In summary only the deleting of the .vs folder is what has worked for me.

    On reopening VS2019 16.2.3 - I can now add in Controllers and Views without seeing this error.

    Found it from Microsoft Developer Community site: https://developercommunity.visualstudio.com/content/problem/626755/error-running-the-selected-code-generator-value-1.html?childToView=684261#comment-684261

    code-generator-solution

    0 讨论(0)
  • 2020-12-03 11:28

    I was able to fix this by replacing the web project with a new one.

    -I renamed the project like project_old folder and removed it from solution. -Added a new project to the solution by right click and add project -Created the old controllers and everything with copying from old project files -Updated nuget packages and deleted old project files

    Clean Solution -> Rebuild Solution and voilla

    0 讨论(0)
  • 2020-12-03 11:31

    try both any one will work either of them.

    1.Just delete .vs folder in project solution.
    2.If above fix does not work.,close your web.config file if it is opened.
    
    0 讨论(0)
  • 2020-12-03 11:34

    I was getting this error - as my project is a git repository, I ran git clean -xfd on it, then rebuilt it and was able to add a controller when I tried again.

    0 讨论(0)
提交回复
热议问题