Error code generator selected run: "exceeds the acceptable value of -1 [0,2147483647] Range Parameter Name:. Value"

When using vs2019 add mvc controller

This was the second encounter this problem. As the saying goes, drink plenty of water, try to restart. Sometimes when the application is not working properly, restart might be able to solve the problem. However, programmers often out of the reach server system permissions. The operation and maintenance personnel and company processes often artificially created problems prevent us from going to restart the application.

The last time was solved by rebooting.

 

Over the wall to find a lot of solutions, like VS team we are still studying the issue

  1. Option One:

    Restart VS.

    Then - Right-click Solution Explorer project, select the "clean-up"

    Then - Rebuild Solution

  2. Option II:
    • The first to use the solution navigate to the project folder and delete the packagesfolder.
    • Delete the folder .vs
    • Then in your project folder deletion of binand objfolders.
    • Close Visual Studio instance.
    • The next step is to navigate to a local user folder:

      For example: C: \ Users \ [YourUserName] \ AppData \ Local \ Microsoft \ VisualStudio (Note AppData folder is hidden by default)

    You will see folders 16.0_or 16.0_e9eb2d6b(depending on your VS version). Navigate to the second folder16.0_e9eb2d6b and delete ComponentModelCacheand Designerfolders.

    • The final step is to open your solution in a VisualStudio project, and then click the Build tab Rebuild Solution .

    Now try to create a View in MVC project.

    If this does not help you, you can also try checking ignore GPU memory access exception of options. You can go to the Visual Studio "Tools" tab -> "Options", and then look in the search GPU and select it.

  3. third solution:

    Continue to write the project, just copy / paste any view ......! Of course, you have to write all the code manually, but at least it lets you add a new view / controller for the project.

Roughly on these types of programs, and the third I did not try, but the first two failed to solve my problem.

I re-created a MVC project controller --- --- Add --- to add a name. This time I noticed vs prompt Loading NuGet package, I think it is not the reason EntityFramework package.

Then back to the original project, right---- --- management NuGet package has been installed find EntityFramework --- --- uninstall and re-install.

Rebuild about the project, we found the problem solved.

Guess you like

Origin www.cnblogs.com/MedlarCanFly/p/11387644.html