Value does not fall within the expected range ошибка

Обновлено: 06.07.2024

I am using the following code to update a listbox, this recieving a list from a Web service:

This works fine, as I use it when the Child window loads, so the ListBox gets the list from the database, however, when a user selects one of the items in the ListBox , they have the option to edit the selected item. So once the edit is in place, there is an edit button, which updates the column in the table in the database. So then on the button click, I am again calling the aforementioned code to update the ListBox with the new credentials. However, this brings back the error:

"Value does not fall within the expected range."

Why can I not call the Web method on the button click, as all it is doing is refreshing the ListBox ?

Applies to: Windows Server 2016, Windows Server 2012 R2
Original KB number: 4049095

Workaround

To work around this issue, use one of the following methods:

Use PowerShell cmdlets or command-line tools (dfsutil.exe or dfsradmin.exe) instead of the DFS Management console.

Type the fully qualified domain name (FQDN) of a server that you want to add instead of searching for the server.

When I open up the solution that contains SSIS packages created by a colleague, I get this awkward error that tells me nothing about what I'm supposed to do to fix it.

He left instructions to take all the "variables" out of the connection string in the dtsx file manually before opening up the solution. I have done that, now when try to view the package in the designer I just get an image of a red x and this message.

EDIT: You cannot see any design elements, no tabs across the top to switch to errors or data flows. Just a gray center area on the screen with a red x, and the message, its like VisualStudio dies in the process of reading the dtsx file.

14.1k 22 22 gold badges 90 90 silver badges 161 161 bronze badges 37.7k 28 28 gold badges 84 84 silver badges 117 117 bronze badges Can you please provide a bit more information. What component type is displaying the red x? Data Source? Data Conversion? Destination? What other components are listed in the Data Flow and in what order?

Resolution

To fix this issue, install the following cumulative updates or later cumulative updates.

Symptoms

  • Create a new replication group and add (select Add) servers to the new replication group.
  • Add a new member to an existing replication group and search (select Browse) for a server that you want to add.
  • Create or edit a new namespace and search (select Browse) for a server that you want to add.

10 Answers 10

The question is rather unspecific so it’s of course difficult to get on the right track here. All of the given answers focus different issues. I would say that PeterX had the best guess. The reason for the error could be as simple as a modified data source.

I came across with a bug "error output has no corresponding output" quite often when adding a new column to a table that needs to be processed by an existing SSIS package. This bug came along with an error message saying that a "Value does not fall within the expected range".

A newly added column needed to be processed by an existing SSIS Package. The expected behavior is that SSIS will recognize that there is a new column and select this column on the columns page of the OLEDB Source Task SSIS to be processed. However, when opening the OLEDB Source Task for the first time after having modified the table I got twice the following error message: "Value does not fall within the expected range." The error message showed up when opening the editor and when opening the Columns page of the editor. Within the Advanced Editor of the OLEDB Source Task the new column showed up in the OLEDB Source Output Columns Tree, but not in the OLEDB Source Error Output Columns Tree. This is the actual underlying problem of the error message. Unfortunately, there seems to be no way to add the missing column manually.

To solve the problem, remove and re-add the newly added column on the Columns Page of the normal Editor as mentioned by Jeff.

It is worth to be mentioned that the data source of the OLEDB Source task was a modified MDS View. Microsoft CRM Dynamics – as mentioned in the related thread – is using views, too. That leads me to the conclusion, that using views as a data source may produce either of the above mentioned errors, when modifying datatypes or adding/removing columns.

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 project. It can list the current references fine.

I rebooted the computer. I am not sure if the recent Update 2 caused this. This is my first add reference since the update. I am using Visual Studio 2013 on Windows 7 64bit.


64.2k 14 14 gold badges 113 113 silver badges 147 147 bronze badges 38.2k 64 64 gold badges 215 215 silver badges 361 361 bronze badges

11 Answers 11

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

More Information

38.2k 64 64 gold badges 215 215 silver badges 361 361 bronze badges @NickG: I did, but the explanation given there was rather skimpy. Unfortunately this suggestion did not work in my case.

Some projects (e.g. some web services) require that Visual Studio be run as an administrator. After a Visual Studio upgrade, I hadn't noticed that it was no longer being started with elevated privileges automatically. When I corrected this, all the projects in the solution loaded.


4,146 3 3 gold badges 28 28 silver badges 25 25 bronze badges This worked for me. I upgraded from VS 2017 to 2019 and forgot to set my shortcut to run as administrator. I have to run as admin because two of my projects use IIS.

In my case, project was set to use local IIS (when the project set up to use local IIS but the app does not deployed there, it cannot load project but states clearly in the error message. However this time I was keep getting Value does not fall within the expected range with any other info.

Only "solution" worked for me was:

  • Edit csproj file
  • Set <UseIISExpress> to true
  • Set <UseIIS> to false
  • Then reload the project.

(after that you can set your local IIS again)


5,012 4 4 gold badges 39 39 silver badges 46 46 bronze badges

Once I got it downloaded and installed, the projects loaded fine. Unfortunately there was no additional information in the Output tab hinting at this.

3,527 2 2 gold badges 29 29 silver badges 47 47 bronze badges In my case this specific version was defined in the projects global.json .

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.


64.2k 14 14 gold badges 113 113 silver badges 147 147 bronze badges

In my case it was simple, if the file is open and then I run it, it will run. If the file is closed and then I run it by right clicking from the "Solution Explorer", then it throws the error you mentioned. So, simple steps: In the Solution Explorer,

  1. Double click on the file and open it
  2. Right click on the file and select "Start with Debugging" or "Start without Debugging"

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.


I have seen this box in VS-2019 16.5.4 in a Winforms/4.8 app with Std classlibs, on attempting to close one of the Winforms/4.8 source file tabs. The message came up, the tab refused to close.

Solved it by closing an re-opening the Solution.

I just had the same, it was only one file which casing this issue, When I read the solution above I was worried to fix all visual studio because one .cs file so I tried to right click on the (TAB header) beside the (X) button which closes this and click on (Close All documents).


917 1 1 gold badge 12 12 silver badges 24 24 bronze badges

Kind of a dumb oversight on my part.. but depending on the action that had caused it, you may want to check your console output as well. In my case it was a project that would not load. While there were no explicit errors, the consol window indicated that a file was missing based on a directive from the csproj.

ECommerce\Prod\EcommerceUtility\ECommerceCommands\ECommerceCommands.csproj : error : The imported project "C:\Program Files (x86)\MSBuildExtensionPack\4.0\MSBuild.ExtensionPack.tasks" was not found.

Confirm that the expression in the Import declaration "C:\Program Files (x86)\MSBuildExtensionPack\4.0\MSBuild.ExtensionPack.tasks" is correct, and that the file exists on disk.

1,278 1 1 gold badge 12 12 silver badges 17 17 bronze badges

I tried the solution described by Tony_Henrich, as it seemed helpful. However in my case, I'm building off a USB drive which is encrypted with BitLocker. I find that the *.c module I want to look at throws this error if I try to force open it with the C++ editor in VS2019 (I'm updating to 16.10.2, so whatever was just before that rev).
Visual Studio was not opening a *.c module in the editor but popping it up in Notepad. If I FORCED it to use Visual Studio C++ editor I got the "Value does not fall" message.

The file is part of a build tree in a repo I'm not responsible for, and it's not building, so at the moment I suspect Bitlocker/USB disk corruption is somehow giving Visual Studio some fits.

Tortoise-GIT Blame tool shows different/valid source code and Notepad shows a chunk missing.

My fix was to delete the file from the workspace and try seeing if GIT could restore a valid copy from the repository, and this worked. Now clicking on the *.c module in Windows Explorer and requesting to open it, no longer brings up Notepad, the file opens in Visual Studio.

Читайте также: