Specified Argument Was Out of the Range of Valid Values. Parameter Name: Site

Specified argument was out of the range of valid values. Parameter name: value

The issue comes from the space in the appSettings file for the port key. You have specified
"port " as a key with a space instead of
"port". This is why the arguments is out of range when you try to instantiate the SmtpClient. If you change your appSettings and remove the space and leave the code as it is. It Will work.

If this resolves your issue. Please chose this as the ideal answer.

Specified argument was out of the range of valid values. Parameter name: site

If using IIS:

  • control panel
  • Programs
  • open or close windows features
  • tick internet information services
  • then restart your visual studio

If using IIS Express:

Open 'Add/Remove Programs' from the old control panel and run a repair on IIS Express
Or you might go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services
and check the checkbox as shown in the picture below:

Sample Image

Exception: Specified argument was out of the range of valid values. (Parameter 'index')

ElementAt does not return null. The randomIndex must be a valid index. Since none intersect. The array is empty and thus will throw an error. Add a condition to check if picked.Count() is greater than zero.

Specified argument was out of the range of valid values. Parameter name: site - Error Due To Creators Update

I found these SO questions:

Specified Argument was out of the range of valid values Parameter name : site

Specified argument was out of the range of valid values (Parameter name: site)

Specified argument was out of the range of valid values. Parameter name: site

None of the accepted answers fixed my error, on the third SO post I found what saved me. I don't have enough rep to comment but I wanted to share this in case anyone else runs into this extremely frustrating bug.

From Sikandar Amla's answer:

I had the same issue with VS2017. Following solved the issue.

  1. Run Command prompt as Administrator.
  2. Write following two commands which will update your registry.

    reg add HKLM\Software\WOW6432Node\Microsoft\InetStp /v MajorVersion /t REG_DWORD /d 10 /f

    reg add HKLM\Software\Microsoft\InetStp /v MajorVersion /t REG_DWORD /d 10 /f

This should solve your problem. Refer to this link for more details.

Specified argument was out of the range of valid values

It seems that you are trying to get 5 items out of a collection with 5 items. Looking at your code, it seems you're starting at the second value in your collection at position 1. Collections are zero-based, so you should start with the item at index 0. Try this:

TextBox box1 = (TextBox)Gridview1.Rows[i].Cells[0].FindControl("txt_type");
TextBox box2 = (TextBox)Gridview1.Rows[i].Cells[1].FindControl("txt_total");
TextBox box3 = (TextBox)Gridview1.Rows[i].Cells[2].FindControl("txt_max");
TextBox box4 = (TextBox)Gridview1.Rows[i].Cells[3].FindControl("txt_min");
TextBox box5 = (TextBox)Gridview1.Rows[i].Cells[4].FindControl("txt_rate");


Related Topics



Leave a reply



Submit