16 instantiations of UriFormatException
Infrastructure.Common (1)
ServiceUtilHelper.cs (1)
554throw new UriFormatException($"UriBuilder didn't like parsing {builder.ToString()}", ufe);
Microsoft.AspNetCore.Components.Tests (2)
RendererTest.cs (2)
3745var exception2 = new UriFormatException(); 3804var exception2 = new UriFormatException();
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Extensions\ProtocolConversions.cs (1)
213throw new UriFormatException($"Failed create URI from '{uriString}'; original string: '{absolutePath}'", e);
Microsoft.Extensions.AI.Abstractions (4)
Contents\DataUriParser.cs (4)
36throw new UriFormatException("Invalid data URI format: the data URI must start with 'data:'."); 45throw new UriFormatException("Invalid data URI format: the data URI must contain a comma separating the metadata and the data."); 62throw new UriFormatException("Invalid data URI format: the data URI is base64-encoded, but the data is not a valid base64 string."); 76throw new UriFormatException("Invalid data URI format: the media type is not a valid.");
PresentationCore (3)
System\Windows\Navigation\BaseUriHelper.cs (3)
274throw new UriFormatException(SR.WrongFirstSegment); 295throw new UriFormatException(SR.WrongFirstSegment); 306throw new UriFormatException(SR.WrongFirstSegment);
System.Private.Uri (5)
System\DomainNameHelper.cs (2)
208throw new UriFormatException(SR.net_uri_BadUnicodeHostForIdn); 214throw new UriFormatException(SR.net_uri_BadUnicodeHostForIdn);
System\Uri.cs (2)
712return new UriFormatException(message); 2601throw new UriFormatException(SR.Format(SR.net_uri_PortOutOfRange, _syntax.GetType(), portStr));
System\UriBuilder.cs (1)
334throw new UriFormatException(SR.net_uri_BadUserPassword);
74 references to UriFormatException
Aspire.Hosting (1)
ApplicationModel\HostUrl.cs (1)
99catch (UriFormatException)
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingDecoders.cs (1)
228catch (UriFormatException exception)
Infrastructure.Common (1)
ServiceUtilHelper.cs (1)
552catch (UriFormatException ufe)
Microsoft.AspNetCore.Components.Tests (2)
RendererTest.cs (2)
3745var exception2 = new UriFormatException(); 3804var exception2 = new UriFormatException();
Microsoft.CodeAnalysis.LanguageServer.Protocol (6)
Extensions\ProtocolConversions.cs (4)
195/// <exception cref="UriFormatException"> 209catch (UriFormatException e) 221/// <exception cref="UriFormatException"> 562catch (UriFormatException)
Handler\References\FindUsagesLSPContext.cs (1)
293catch (UriFormatException e) when (FatalError.ReportAndCatch(e))
Protocol\DocumentUri.cs (1)
57catch (UriFormatException)
Microsoft.Extensions.AI.Abstractions (1)
Contents\UriContent.cs (1)
33/// <exception cref="UriFormatException"><paramref name="uri"/> is an invalid URL.</exception>
Microsoft.Extensions.AI.Abstractions.Tests (16)
Contents\DataContentTests.cs (15)
30[InlineData("data:", typeof(UriFormatException))] // data missing comma 31[InlineData("data:something,", typeof(UriFormatException))] // mime type without subtype 32[InlineData("data:something;else,data", typeof(UriFormatException))] // mime type without subtype 33[InlineData("data:type/subtype;;parameter=value;else,", typeof(UriFormatException))] // parameter without value 34[InlineData("data:type/subtype;parameter=va=lue;else,", typeof(UriFormatException))] // parameter with multiple = 35[InlineData("data:type/subtype;=value;else,", typeof(UriFormatException))] // empty parameter name 36[InlineData("data:image/j/peg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD", typeof(UriFormatException))] // multiple slashes in media type 39[InlineData("data:text;base64,something!", typeof(UriFormatException))] // Invalid base64 due to invalid character '!' 40[InlineData("data:text/plain;base64,U29tZQ==\t", typeof(UriFormatException))] // Invalid base64 due to tab character 41[InlineData("data:text/plain;base64,U29tZQ==\r", typeof(UriFormatException))] // Invalid base64 due to carriage return character 42[InlineData("data:text/plain;base64,U29tZQ==\n", typeof(UriFormatException))] // Invalid base64 due to line feed character 43[InlineData("data:text/plain;base64,U29t\r\nZQ==", typeof(UriFormatException))] // Invalid base64 due to carriage return and line feed characters 44[InlineData("data:text/plain;base64,U29", typeof(UriFormatException))] // Invalid base64 due to missing padding 45[InlineData("data:text/plain;base64,U29tZQ", typeof(UriFormatException))] // Invalid base64 due to missing padding 46[InlineData("data:text/plain;base64,U29tZQ=", typeof(UriFormatException))] // Invalid base64 due to missing padding
Contents\UriContentTests.cs (1)
17Assert.Throws<UriFormatException>(() => new UriContent("notauri", "image/png"));
Microsoft.Maui.Essentials (12)
Launcher\Launcher.shared.cs (12)
24 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 32 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 47 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 66 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 75 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 84 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 93 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 110 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 119 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 185 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 195 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception> 205 /// <exception cref="UriFormatException">Thrown when <paramref name="uri"/> is malformed.</exception>
Microsoft.VisualStudio.LanguageServices (1)
NavigateTo\RoslynSearchResultViewFactory.cs (1)
73catch (UriFormatException)
netstandard (1)
netstandard.cs (1)
2227[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.UriFormatException))]
PresentationCore (1)
System\Windows\Media\FontFamily.cs (1)
541catch (UriFormatException)
PresentationUI (1)
MS\Internal\Documents\RMPublishingDialog.cs (1)
348catch (UriFormatException e)
ReachFramework (1)
Serialization\ImageSourceTypeConverter.cs (1)
236catch (UriFormatException)
System (1)
src\libraries\shims\System\ref\System.cs (1)
927[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.UriFormatException))]
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
168catch (UriFormatException e)
System.Private.Uri (15)
System\Uri.cs (4)
574relativeUri = baseUri.Syntax.InternalResolve(baseUri, this, out UriFormatException? e); 620newUriString = baseUri.Syntax.InternalResolve(baseUri, this, out UriFormatException? e); 687private static UriFormatException GetException(ParsingError err) 1955internal UriFormatException? ParseMinimal()
System\UriExt.cs (7)
20UriFormatException? e = TryCreateThis(uri, dontEscape, uriKind, in creationOptions); 30private UriFormatException? TryCreateThis(string? uri, bool dontEscape, UriKind uriKind, in UriCreationOptions creationOptions = default) 118_syntax.InternalValidate(this, out UriFormatException? e); 146catch (UriFormatException ex) 278newUriString = baseUri.Syntax.InternalResolve(baseUri, relativeUri, out UriFormatException? e); 644UriFormatException? e = result.TryCreateThis(uriString, dontEscape, uriKind, in creationOptions); 647catch (UriFormatException)
System\UriScheme.cs (2)
65protected virtual void InitializeAndValidate(Uri uri, out UriFormatException? parsingError) 98protected virtual string? Resolve(Uri baseUri, Uri? relativeUri, out UriFormatException? parsingError)
System\UriSyntax.cs (2)
260internal void InternalValidate(Uri thisUri, out UriFormatException? parsingError) 270internal string? InternalResolve(Uri thisBaseUri, Uri uriLink, out UriFormatException? parsingError)
System.Runtime (1)
artifacts\obj\System.Runtime\Debug\net11.0\System.Runtime.Forwards.cs (1)
888[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.UriFormatException))]
System.ServiceModel.NetFramingBase (1)
System\ServiceModel\Channels\FramingDecoders.cs (1)
234catch (UriFormatException exception)
System.ServiceModel.Primitives.Tests (2)
ServiceModel\DuplexChannelFactoryTest.cs (2)
46Assert.Throws<UriFormatException>(() => 58Assert.Throws<UriFormatException>(() =>
System.Windows.Forms (5)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
158catch (UriFormatException)
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (1)
581catch (UriFormatException)
System\Windows\Forms\Controls\WebBrowser\WebBrowserUriTypeConverter.cs (1)
21catch (UriFormatException)
System\Windows\Forms\Help\Help.cs (2)
246catch (UriFormatException) 271catch (UriFormatException)
System.Windows.Forms.Tests (2)
System\Windows\Forms\HtmlElementErrorEventArgsTests.cs (1)
43action.Should().Throw<UriFormatException>();
System\Windows\Forms\WebBrowserUriTypeConverterTests.cs (1)
52action.Should().Throw<UriFormatException>();
WindowsBase.Tests (1)
System\Security\RightsManagement\PublishLicenseTests.cs (1)
138Assert.Throws<UriFormatException>(() => new PublishLicense(PublishLicenseTemplate));