值 -1 超出了 [0,2147483647] 的可接受范围.参数名称:值 [英] the value -1 is outside the acceptable range of [0,2147483647]. Parameter name: value
问题描述
使用 Visual Studio 2019 搭建任何控制器的问题我收到错误:
运行所选代码生成器时出错:'值 -1 超出了 [0,2147483647] 的可接受范围.参数名称:值'"
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
我尝试了以下方法:
1.(在 Visual Studio 2019 中生成视图时出错)
2. (无法在 VS 2015 中从控制器添加视图:运行所选代码生成器时出错")
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")
推荐答案
该问题现已通过 Visual Studio 2019 的最新版本解决:版本 16.2.5:https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.5
The issue is now fixed with the latest release of Visual Studio 2019: version 16.2.5: https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.2.5
问题只会在以下情况下发生:
The issue would only to happen when:
- 您已在 Visual Studio 中打开了项目的 web.config 文件.
所以解决方法是:
- 如果出现错误,请确保关闭 web.config 文件,这样您就可以搭建控制器.
这篇关于值 -1 超出了 [0,2147483647] 的可接受范围.参数名称:值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!