I have downloaded the example which is pointed out in the beginning of the article and it's outdated - version is 2.2 when the page is placed under version 3.1 and when I open up the page I get aggregated exceptions which is basically about NullReferenceException.
So please, either fix the existing example, so that it won't throw some strange un-debuggable (or at least hard-to-debug-for-newbie) exceptions, or upload the new version which will be applicable to version 3.1.
Thanks!
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
and this is the stacktrace:
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.VisualStudio.Web.BrowserLink.ScriptInjectionFilterStream.FirstWriteToInjectScriptSocketAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task 1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.System.IDisposable.Dispose()
at Microsoft.VisualStudio.Web.BrowserLink.ScriptInjectionFilterStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.ExecuteWithFilter(IHttpSocketAdapter injectScriptSocket, String requestId, HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)
at Microsoft.VisualStudio.Web.BrowserLink.ScriptInjectionFilterStream.FirstWriteToInjectScriptSocketAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)<---
fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[3]
An exception was thrown attempting to display the error page.
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.WaitAllCore(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks)
at Microsoft.VisualStudio.Web.BrowserLink.ScriptInjectionFilterStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Write(String value)
at Microsoft.AspNetCore.Diagnostics.RazorViews.ErrorPage.ExecuteAsync()
at Microsoft.Extensions.RazorViews.BaseView.ExecuteAsync(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)<---
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HM0371PN8G0G", Request id "0HM0371PN8G0G:00000002": An unhandled exception was thrown by the application.
System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task 1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.System.IDisposable.Dispose()
at Microsoft.VisualStudio.Web.BrowserLink.ScriptInjectionFilterStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.ExecuteWithFilter(IHttpSocketAdapter injectScriptSocket, String requestId, HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication 1 application)
---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.AddRequestHeaders(IHttpSocketAdapter httpSocket, String requestId, Boolean isHttps, String hostUrl)
at Microsoft.VisualStudio.Web.BrowserLink.BrowserLinkMiddleware.<>c__DisplayClass9_0.<<GetSocketConnectionToHost>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.CreateSocketConnectionAsync()
at Microsoft.VisualStudio.Web.BrowserLink.DelayConnectingHttpSocketAdapter.Microsoft.VisualStudio.Web.BrowserLink.IHttpSocketAdapter.WriteToRequestAsync(Byte[] buffer, Int32 offset, Int32 count)<---
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 2083.9709ms 500
@DavidShukvani try removing browserlink.
@hishamco any chance you could make a
https://github.com/dotnet/AspNetCore.Docs/tree/master/aspnetcore/fundamentals/localization/sample/3.x folder and copy the samples over and update to 3.1?
Sure, hope to push a PR ASAP
Fixed in #18556
Most helpful comment
Sure, hope to push a PR ASAP