.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

ScriptResource.axd throws ArgumentOutOfRangeException

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net

I've done a lot of research on this error and I can't seem to figure it out:


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

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate

Source Error: 

View Complete Post

More Related Resource Links

Solved: InstallUtil throws ArgumentOutOfRangeException when trying to install windows service.

This is just to help people troubleshoot the ArgumentOutOfRangeException problem when trying to install a windows service with installutil. It took me a good while to understand the reason of the install failure and I could not find anything about this on the web concerning this problem, so hopefully this will help others in the future so they don't waste as much time as I did.

If you get:

An exception occurred during the Install phase.
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length


1) Go to the deisgner of your ProjectInstaller
2) Select the ServiceProcessInstaller
3) Go to the properties of the ServiceProcessInstaller.
4) If you see Account property set to user, change it to LocalSystem.
5) Rebuild your project.
6) Rerun installutil YourService.exe

Then the exception should be gone and the installation successful.


Sylvain Boissé Software Architect Noesis Innovation www.noesisinnovation.net

StringBuilder.ToString() Throws a System.ArgumentOutOfRangeException Index was out of range


I have the following code to show a logging window that has the last 64000 chars of code. Every new line I add the first line will be deleted:

m_sbText = new StringBuilder(65000);

private void AddLine(string LogMessage)
   if (m_sbText.Length > 64000)
      m_sbText.Remove(0, m_sbText.ToString().IndexOf("\n") + 1);
   textBoxLog.Text = m_sbText.ToString();

When I let this run the first time I got an OutOfMemory exception because I forgot to add

textBoxLog.UndoLimit = 0;

So this UndoLimit problem is still happening in WPF dot net framework 4. 

I added the UndoLimit and let this run for a night. Once every few hours the textBoxLog.Text = m_sbText.ToString(); line raises a System.ArgumentOutOfRangeException Index was out of range exception on StringBuilder.ToString(). Because I do not do anything with the Index I suspect the StringBuilder to mess up internal indexes.

Optimize WebResource.axd and ScriptResource.axd in asp.net

When the handler is requested by the browser it looks for a URL parameter containing the references to the original resource script. They are separated by a comma in the URL parameter. It then retrieves the content of each script using a HTTP request. Then content is then aggregated into a single string which then get's minified. Minifying means that all comments and whitespace is removed from the script.

userprincipal.changepassword throws exception


Hi all,

      userprincipal.changepassword(oldpassword, newpassword);

gives error: that is Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)

but userDirectoryEntry.invoke("ChangePassword", new object[] { oldpassword, newpassword });

      userDirectoryEntry.CommitChanges works fine.

Any one please tell me the reason behind this.

WebControls.TableRow throws exception on Add()


I have the following method to strip hidden and user-specified columns from a gridviewrow and return a tablerow. 

    Private Shared Function StripHiddenColumns(ByVal gvRow As GridViewRow, ByVal ColumnsToExclude() As Integer) As TableRow

        Dim row As New TableRow
        Dim i As Integer = 0
            For Each cell As TableCell In gvRow.Cells
                If cell.Visible Then
                    If Not ColumnsToExclude.Contains(i) Then
                    End If
                End If
                i += 1

            Return row
        Catch ex As Exception
            Throw ex
        End Try
    End Function

However, when I run this code and hit the Add method for the TableRow,  I get an InvalidOperationException stating the Collection was modified; enumeration operation may not execute.  I've gotten this exception before, but usually it's because I'm attempting to modify a table that is databound.  This particular one is not, i am creating it.  Can anyone offer any insight? 

Thanks in advance.


Security trimmed URL throws an error if not logged in

On a Moss 2007 site, using FBA - I have an issue with security trimmed items within Lists.   There is not a problem with direct url links to non-list items.  
For list items - here is the problem, when a user is not logged in and follows a direct url link from an email or newsletter to security trimmed items within a list - it throws an error instead of offering a redirect to login?

More info:  This is only occurring for individually security trimmed list items that have had anonymous access removed.  When a whole list or library has had anonymous removed, the links work fine (login page appears, log in, taken to original link).

Why is that and is there a way to avoid the error?

If it is of help, this is the error. Thanks in advance.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not
set to an insta

SPWorkflowManager.CancelWorkflow throws an exception


Sorry, I had posted that same question in the "Dev and Programming" forum, but I'm reposting here because it's more of a workflow related question.

We are trying to cancel workflow programmatically.

It used to work fine until we migrated our environment to a new server and now it fails.

Our code goes something like this: 


foreach (SPWorkflow wf in form.Workflows)


//code omitted for brievety



But an ArgumentException is thrown.

Msdn docs say that an ArgumentNullException exception can be thrown (ArgumentNullException: The workflow to cancel belongs to an SPWeb object that has been deleted) but it is actually an ArgumentException that is thrown. Plus I know for sure that the SPWeb does not get deleted.

I tried to reflector what piec

access denied Scriptresource.axd

HiMy web site does not seem to work and showing this error.I am using an ajax control toolkit update panel. When I click anything which is in the in the update panel I have the following error."access denied Scriptresource.axd" .But only in IE. With crome it works fine.I tried to google it but didn't get any concrete answer.any help??

Remoting from WebService throws: An existing connection was forcibly closed by the remote host

Hello everyone, I have a problem with using .NET remoting from webservice. When using remoting from console application, there is no problem. I suppose problem is somewhere in IIS. My system is Windows Vista. Thank you for any help. Best regards, Jozef

ssrs 2008 R2 - report parameter with no default set throws java script error

We have recently upgraded from SQL Server 2008 to SQL Server 2008 R2....I am experiencing a problem with my report parameters on my SSRS reports. It seems that my report parameters that I do not have a specified 'default' value throws a java script error when I try and run/render the report under R2.  As soon as I put a 'default' value on the report param, everything is fine.  However, that is not the behavior we need for our reports...the user needs to pick their selection. Can anyone shed some light on this, it seems to be an AJAX problem...I need to be able to have report parameters with a list of values, but no 'default' value on the parameter.

Master-Detail GridView in Single Page example with paging throws error

___http://www.java2s.com/Code/ASP/Data-Binding/MasterDetailGridViewinSinglePage.htmI followed example at the link above.When I enablind paging=true (by pagesize=3).and clicking to pages 2|3|4 etc and so;error occuringIndex was out of range. Must be non-negative and less than the size of the collection.at cs line :sourceProducts.SelectParameters[0].DefaultValue = gridMaster.DataKeys[e.Row.DataItemIndex].Value.ToString();got any idea?what should I make to fix this ? is this error  fixable ?thanks much.

ArgumentOutOfRangeException Crossed native/managed boundary

When run my application i got this error at the starting. ArgumentOutOfRangeException Crossed native/managed boundary Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index How solve this. This Exception coming when i access the following private Collection m_coll; Public Collection coll {   set{m_coll=value;}   get{return m_coll;} } I have initialized the coll in constructor. In 2010 its working fine. Thanks,

ArgumentOutOfRangeException on mouse over (showing tooltip?)

Hello, I encounter an ArgumentOutOfRangeException when moving the mouse over one of my component... I can't reproduce it but it happens regularly and to different users... This is the stack: System.ArgumentOutOfRangeException: TimeSpan period must be less than or equal to Int32.MaxValue. Parameter name: value at System.Windows.Threading.DispatcherTimer.set_Interval(TimeSpan value) at System.Windows.Controls.PopupControlService.RaiseToolTipOpeningEvent() at System.Windows.Controls.PopupControlService.OnRaiseToolTipOpeningEvent(Object sender, EventArgs e) at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode back

Process.MainModule on x64 platform throws Win32Exception: "Only part of a ReadProcessMemory or Write

This is a very odd issue and I think it should be a bug of .Net framework. the code is like below: class Program { static void Main(string[] args) { try { Process[] procs = Process.GetProcessesByName("abc"); if(procs == null || procs.Length < 1) return; Process proc = procs[0]; Console.WriteLine("Got it: " + proc.MainModule.ModuleName); } catch (Exception ex) { Console.WriteLine("Failed to get process: {0}", ex); } Console.Read(); } } the "abc.exe" is another program compiled with "For Any CPU", and the testing operating system is Windows 2003 x64 When the code is compiled with "x64" or "For Any CPU", it works very well. but, if I change the compiling configuration to "x86", it will throw out a Win32Exception "Only part of a ReadProcessMemory or WriteProcessMemory request was completed" stack trace:    at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly)    at System.Diagnostics.NtProcessManager.GetFirstModuleInfo(Int32 processId)    at System.Diagnostics.Process.get_MainModule()    at KillProcessTest.Program.Main(String[] args) in D:\Users\rsp\KillProcessTest\KillProcessTest\Program.cs:line 18

SSRS 2008 R2 - OnPostBack from ReportParameter - if no default set, throws Value can not be null

SSRS 2008 R2 - OnPostBack from Parameter selection - if no default set, throws Value can not be null java script error. This does not happen with SSRS 2008, only with R2. and only with report parameters that do not have a 'default' set.  Any suggestions would be greatly appreciated.

Report fine; PDF export fine; Excel export crashes - ArgumentOutOfRangeException

I use the Report Viewer Redistributable 2005 Service Pack 1 (version 8.0.50727.1843). On my ASP.NET page the report displays fine, in a ReportViewer control, using an rdlc file. Export to PDF works fine. Export to Excel crashes. Stack does not tell me much because it's all internal to the Report Viewer:[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index]   System.Collections.ArrayList.get_Item(Int32 index) +7483656   Microsoft.ReportingServices.Rendering.ExcelRenderer.DoubleList.get_Item(Int32 index) +5   Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.RenderImage(Image image, PageTableGrid pageTableGrid, PageReportItemInfo reportItemInfo, PageCell pageCell, Int32 row, Int32 col, Boolean addHeaderRows) +907   Microsoft.ReportingServices.Rendering.ExcelRenderer.ExcelRenderer.RenderGridCell(PageLayout pageLayout, Int32 row, Int32 col, Hashtable& duplicateItemsTable, Boolean addHeaderRows, ReportItem parentItem, Hashtable riReferenceTable) +1317   Microsoft.ReportingServices.Rendering.BIFFUtility.WorkSheet.WriteRowBlocksAndCells(ExcelRenderer excelRenderer, Stream stream, UInt32 indexBeginOffsetPosition, Int32 minCol, Int32 maxCol) +936   Microsoft.ReportingServices.Rendering.BIFFUtility.BaseWorkSheet.WriteWorkSheet

EvaluateOldNewStates() throws exception when updating TreeViewItem.IsSelected

I apply a WPF theme in my application. At some point in my code, I need to change the selected tree view item. so I update the property MyViewModel.IsSelected and raise PropertyChanged event. Then I get this: Object reference not set to an instance of an object. System.Windows.StyleHelper.EvaluateOldNewStates(MultiTrigger multiTrigger, DependencyObject triggerContainer, DependencyProperty changedProperty, DependencyPropertyChangedEventArgs changedArgs, Int32 sourceChildIndex, Style style, FrameworkTemplate frameworkTemplate, Boolean& oldState, Boolean& newState) System.Windows.StyleHelper.InvokePropertyTriggerActions(TriggerBase triggerBase, DependencyObject triggerContainer, DependencyProperty changedProperty, DependencyPropertyChangedEventArgs changedArgs, Int32 sourceChildIndex, Style style, FrameworkTemplate frameworkTemplate) System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex) System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEve
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend