0

I'm trying to fix a bug in a particular page on our website, so I've pulled the repo down to my machine (Visual studio), fired it up on localhost and I have a weirdly specific error.

Everything works perfectly until I try to display this 1 particular data set as a table on the page (which I have to do, because that's the one with the bulk download bug I'm trying to fix). The same code/data-set on the server works fine in both dev and test, I'm pulling in the data from the same db. The server download works fine with all the records taken in small chunks, so the individual data items look good.

I've tried changing the settings as in this answer (Compilation Error: [No relevant source lines]) and it hasn't helped (and anyway the code per se is working). Doesn't matter if I take a small or large number of records to display it always gives [No relevant source lines] and fails on my view at line 0.

I've tried commenting out absolutely everything on the view (to rule out errors there, so the page loads blank) works for the other data-sets but it still fails instantly for this one. The data's loading into the viewmodel fine.

I've put the debug code

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

into my config. Any suggestions what to try next?

Full error message:

[No relevant source lines]
[WebException: The request was aborted: The request was canceled.]
   System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) +6927066
   System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size) +118
   System.IO.BinaryWriter.Write(Int32 value) +73
   Microsoft.WebTools.BrowserLink.Runtime.Tracing.MappingDataWriter.WriteBeginContext(Int32 sourceStartPosition, Int32 sourceLength, Boolean isLiteral, String sourceFilePath, Int32 renderedOutputIndex, Int32 renderedPosition) +81
   Microsoft.WebTools.BrowserLink.Runtime.Tracing.DataDispatchExecutionListener.BeginContext(PageExecutionContext context) +126
   CallSite.Target(Closure , CallSite , Object , Object ) +199
   System.Web.WebPages.Instrumentation.PageExecutionListenerAdapter.BeginContext(PageExecutionContextAdapter context) +184
   System.Web.WebPages.Instrumentation.InstrumentationService.BeginContext(HttpContextBase context, String virtualPath, TextWriter writer, Int32 startPosition, Int32 length, Boolean isLiteral) +160
   System.Web.WebPages.WebPageExecutingBase.BeginContext(String virtualPath, Int32 startPosition, Int32 length, Boolean isLiteral) +151
   ASP._Page_Views_Pages_PublishUpdates_cshtml.Execute() in C:\{bla bla}\Website\Views\Pages\PublishUpdates.cshtml:0
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +197
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
   System.Web.WebPages.StartPage.RunPage() +17
   System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +256
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +52
   System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +173
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9836613
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +50
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +163
Louise
  • 382
  • 1
  • 6
  • 16
  • I'd try and work out why the request is getting aborted in the first place: I don't think the actual lines of code here are going to help. It looks like that's a method Abort (and a flag Aborted) on HttpWebRequest: I don't know how easy it would be to set a breakpoint on the code that's calling that or changing that? (Which is going to be framework code.) Or have VS break on all exceptions to see if it's an exception that's getting caught somewhere along the way. – Rup Feb 12 '20 at 10:55
  • Oh.. thank you Rup, i'll look at that! – Louise Feb 12 '20 at 10:57
  • It appears that the error is casued by BrowserLink - I noticed a reference to BrowserLink in the callstack near the top. Try disabling browser link in Visual Studio. – phuzi Feb 12 '20 at 12:15
  • 1
    @phuzi Thank you so much! That worked. Please put that in as an answer so I can mark it as such :-) – Louise Feb 12 '20 at 13:38

1 Answers1

1

Looking at the call stack, it appears that the error is casued by something failing in Browser Link:

[No relevant source lines]
[WebException: The request was aborted: The request was canceled.]
   System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state) +6927066
   System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size) +118
   System.IO.BinaryWriter.Write(Int32 value) +73
   Microsoft.WebTools.BrowserLink.Runtime.Tracing.MappingDataWriter.WriteBeginContext(Int32 sourceStartPosition, Int32 sourceLength, Boolean isLiteral, String sourceFilePath, Int32 renderedOutputIndex, Int32 renderedPosition) +81
   Microsoft.WebTools.BrowserLink.Runtime.Tracing.DataDispatchExecutionListener.BeginContext(PageExecutionContext context) +126
   ...

To fix this you should disable Browser Link in Visual Studio.

phuzi
  • 12,078
  • 3
  • 26
  • 50