Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

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

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 view, I get the following error message:

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

This issue only arises in the project that I'm currently working on as I tried creating a new controller in another project and it worked flawlessly.

I already tried the solution to delete the ComponentModelCache folder and rebuilding the project but the problem still persists.
My Visual Studio 2019 is also up to date.

EDIT: Pulling the project from git source control on another PC and restoring the packages fixed the issue for me. You probably don't have to do it from another computer, just try deleting the project and restoring it from remote.

EDIT 2: Creating a second view and the same problem is back again...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I fixed this by unloading and reloading the project


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...