BugNET – Error with attachments in version 0.9.142.0

A new version of BugNET was released recently (18th of December 2011). You might encounter a problem with attachments to an issue, with an error page.

Here is the error you’ll get in the logs :

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at BugNET.Issues.UserControls.Attachments.CleanFileName(String fileName)
   at BugNET.Issues.UserControls.Attachments.AttachmentsDataGridItemDataBound(Object sender, DataGridItemEventArgs e)
   at System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource)
   at System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource)
   at System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
   at BugNET.Issues.UserControls.Attachments.BindAttachments()
   at BugNET.Issues.UserControls.Attachments.Initialize()
   at BugNET.Issues.UserControls.IssueTabs.LoadTab(String selectedTab)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Unfortunately this is a bug, that has been described and fixed here : http://support.bugnetproject.com/Issues/IssueDetail.aspx?id=2028

In case you cannot wait for the next release that will inlcude this fix, or if don’t want to bother downloading the source code, fix the bug and compile it, you’ll find below some easy step to fix the bug on your platform (it will litterally take you 2 minutes), assuming you are using version 0.9.142.0

Step 0 : Make sure you are using version 0.9.142.0. If you are using another version, DO NOT follow the next steps.

Step 1 : Download the attached file and unzip it.

Step 2 : Copy the file BugNET.dll to your bugNET platform in the bin folder. Just replace the existing file.

Done ! Try to upload or view an attachment, you’ll see that it works.

Hope this will help someone.

One thought on “BugNET – Error with attachments in version 0.9.142.0

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>