FileUploader exception due to case-sensitive deduction of FileUploader web service


While using the NUnitTFS executable I noticed an issue while publishing the NUnit (trx) test results to TFS.

Error occcurred during publishing of NUnit test results: System.TypeInitializationException: The type initializer for 'KWatkins.NUnitTfs.Tfs2010.FileUploader' threw an exception. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.

After debugging I noticed that the private FileUploader constructor uses a case-sensitive substring method to deduct the AttachmentUpload url (from the TestResults.asmx service). My config file contained the full endpoint address in lowercase and didn't recognize "TestResults.asmx"

Suggested fix in FileUploader.cs file:

Url = clientUrl.Substring(0, clientUrl.IndexOf("TestResults.asmx", System.StringComparison.InvariantCultureIgnoreCase)) + "AttachmentUpload.ashx";
Closed Nov 24, 2011 at 3:22 AM by


wrote Nov 24, 2011 at 3:22 AM

Resolved with changeset 63605.

wrote Nov 24, 2011 at 3:22 AM

Changed.  Thanks!