You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI (Internal): [Microsoft-ApplicationInsights-Extensibility-Web] Unknown error, message System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Web.Util.UriUtil.BuildUriImpl(String scheme, String serverName, String port, String path, String queryString, Boolean useLegacyRequestUrlGeneration)
at System.Web.HttpRequest.BuildUrl(Func1 pathAccessor)
at System.Web.UnvalidatedRequestValues.get_Url()
at Microsoft.ApplicationInsights.Common.RequestTrackingUtilities.UpdateRequestTelemetryFromRequest(RequestTelemetry requestTelemetry, HttpRequest request, IApplicationIdProvider applicationIdProvider)
at Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule.OnEndRequest(HttpContext context)
at Microsoft.ApplicationInsights.Web.AspNetDiagnosticTelemetryModule.AspNetEventObserver.OnNext(KeyValuePair2 value)
public sealed class UnvalidatedRequestValues {
private Uri _url;
public Uri Url {
get {
if (_url == null) {
_url = _request.BuildUrl(() => Path);
}
return _url;
}
}
private void CreateThis(string uri, bool dontEscape, UriKind uriKind)
{
// if (!Enum.IsDefined(typeof(UriKind), uriKind)) -- We currently believe that Enum.IsDefined() is too slow
// to be used here.
if ((int)uriKind < (int)UriKind.RelativeOrAbsolute || (int)uriKind > (int)UriKind.Relative) {
throw new ArgumentException(SR.GetString(SR.net_uri_InvalidUriKind, uriKind));
}
m_String = uri == null? string.Empty: uri;
if (dontEscape)
m_Flags |= Flags.UserEscaped;
ParsingError err = ParseScheme(m_String, ref m_Flags, ref m_Syntax);
UriFormatException e;
InitializeUri(err, uriKind, out e);
if (e != null)
throw e;
}
The text was updated successfully, but these errors were encountered:
Error:
Source:
ApplicationInsights-dotnet/WEB/Src/Common/RequestTrackingUtilities.cs
Lines 20 to 30 in 35e4bb2
The getter for the Unvalidated Url is failing to parse and create a Uri object.
Should we wrap this in a try/catch and ignore the Exception?
Internal Call Stack:
https://referencesource.microsoft.com/#System.Web/UnvalidatedRequestValues.cs,144
https://referencesource.microsoft.com/#System/net/System/UriExt.cs,32
The text was updated successfully, but these errors were encountered: