“Value does not fall within the expected range” when trying to add a reference in a project

后端 未结 9 572
栀梦
栀梦 2020-12-02 16:31

Suddenly I am getting this error \"Value does not fall within the expected range\" whenever I try to add a reference to any project. This also happens with a new blank proje

相关标签:
9条回答
  • 2020-12-02 17:30

    I did a 'devenv /setup' and that fixed it.

    Detail

    • Exit Visual Studio
    • Click Start
    • Type cmd, right click Command Prompt and select Run as administrator
    • Navigate to the appropriate Visual Studio folder
      VS2012: pushd %programfiles(x86)%\Microsoft Visual Studio 12.0\Common7\IDE
      VS2015: pushd %programfiles(x86)%\Microsoft Visual Studio 14.0\Common7\IDE
      VS2017: pushd %programfiles(x86)%\Microsoft Visual Studio\2017\<Edition>\Common7\IDE
      VS2019: pushd %programfiles(x86)%\Microsoft Visual Studio\2019\<Edition>\Common7\IDE

    • Type devenv /setup and press enter

    • When the command prompt returns, you're done. Close the command window, reopen Visual Studio, and test to see if the error's resolved.

    More Information

    https://msdn.microsoft.com/en-us/library/ex6a2fad.aspx

    0 讨论(0)
  • 2020-12-02 17:33

    In my case the file name inside the Solution .sln was wrong (mot exist on disk).

    I open the solution file MyFullsolution.sln using a text editor and check the Project load files and found that the project ProjectFile.csproj that fails to load was typed wrong.

    How that happens ? Because I rename it from the solution some day, but I use the same ProjectFile.csproj again on a different solution! and I rename it in one solution, but the other just didn't know it... and get the same message (that actual not help at all).

    So was my mistake the file rename from the other solution.

    0 讨论(0)
  • 2020-12-02 17:35

    I also got the same error with "web" tab missing from project properties, for those having this issue can try changing the target framework of the project.When I changed target framework from 4.6.2 to 4.7.2, the web tab appeared again.

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