195 references to TryCreate
Aspire.Azure.AI.OpenAI (3)
AspireConfigurableOpenAIExtensions.cs (1)
91if (connectionBuilder.TryGetValue(ConnectionStringEndpoint, out var endpoint) && endpoint != null && Uri.TryCreate(endpoint.ToString(), UriKind.Absolute, out var endpointUri))
AzureOpenAISettings.cs (2)
92if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 103if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
Aspire.Azure.Data.Tables (1)
AzureDataTablesSettings.cs (1)
56if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Azure.Messaging.WebPubSub (1)
AzureMessagingWebPubSubSettings.cs (1)
61if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Azure.Search.Documents (2)
AzureSearchSettings.cs (2)
60if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 71if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
Aspire.Azure.Security.KeyVault (1)
AzureSecurityKeyVaultSettings.cs (1)
46Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Azure.Storage.Blobs (1)
AzureStorageBlobsSettings.cs (1)
57if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Azure.Storage.Queues (1)
AzureStorageQueuesSettings.cs (1)
57if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Dashboard (4)
Configuration\DashboardOptions.cs (1)
40if (!Uri.TryCreate(Url, UriKind.Absolute, out _parsedUrl))
Model\BrowserLinkOutgoingPeerResolver.cs (1)
43if (Uri.TryCreate(url, UriKind.Absolute, out var uri) && string.Equals(uri.Host, "localhost", StringComparisons.UrlHost))
ResourceService\Partials.cs (1)
94let parsedUri = Uri.TryCreate(u.FullUrl, UriKind.Absolute, out var uri) ? uri : null
src\Shared\StringUtils.cs (1)
14&& Uri.TryCreate(splitInput[0], UriKind.Absolute, out uri))
Aspire.Elastic.Clients.Elasticsearch (2)
ElasticClientsElasticsearchSettings.cs (2)
56if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 67if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
Aspire.Hosting (2)
Dashboard\TransportOptionsValidator.cs (1)
80if (!Uri.TryCreate(value, UriKind.Absolute, out var parsedUri))
src\Shared\StringUtils.cs (1)
14&& Uri.TryCreate(splitInput[0], UriKind.Absolute, out uri))
Aspire.Hosting.Azure.CosmosDB (1)
AzureCosmosDBExtensions.cs (1)
161if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Hosting.Azure.Storage (1)
AzureStorageExtensions.cs (1)
140if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Hosting.Qdrant (2)
QdrantBuilderExtensions.cs (2)
157if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 168if (connectionBuilder.TryGetValue("Endpoint", out var endpointValue) && Uri.TryCreate(endpointValue.ToString(), UriKind.Absolute, out var serviceUri))
Aspire.Microsoft.Azure.Cosmos (1)
AspireMicrosoftAzureCosmosExtensions.cs (1)
76if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
AspireAzureEFCoreCosmosExtensions.cs (1)
56if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri))
Aspire.Milvus.Client (2)
MilvusClientSettings.cs (2)
42if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 53if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
Aspire.OpenAI (1)
OpenAISettings.cs (1)
82if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
Aspire.Qdrant.Client (2)
QdrantClientSettings.cs (2)
44if (Uri.TryCreate(connectionString, UriKind.Absolute, out var uri)) 55if (connectionBuilder.ContainsKey(ConnectionStringEndpoint) && Uri.TryCreate(connectionBuilder[ConnectionStringEndpoint].ToString(), UriKind.Absolute, out var serviceUri))
BuildActionTelemetryTable (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
256=> Uri.TryCreate(descriptor.HelpLinkUri, UriKind.Absolute, out var uri) &&
BuildBoss (1)
ProjectCheckerUtil.cs (1)
140if (!Uri.TryCreate(internalsVisibleTo.WorkItem, UriKind.Absolute, out _))
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
142return Uri.TryCreate(file, UriKind.Absolute, out var _) && file.StartsWith("http", StringComparison.Ordinal);
dotnet-svcutil.xmlserializer (2)
Microsoft\Tools\ServiceModel\SvcUtil\InputModule.cs (1)
83if (Uri.TryCreate(path, UriKind.Absolute, out serviceUri) && !serviceUri.IsFile)
Microsoft\Tools\ServiceModel\SvcUtil\OutputModule.cs (1)
167if (Uri.TryCreate(ns, UriKind.RelativeOrAbsolute, out nsUri))
dotnet-svcutil-lib (27)
FrameworkFork\Microsoft.Xml\Xml\XmlConvert.cs (2)
1528if (!Uri.TryCreate(s, UriKind.RelativeOrAbsolute, out uri)) 1547if (!Uri.TryCreate(s, UriKind.RelativeOrAbsolute, out result))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
1425if (Uri.TryCreate(dataContractNamespace, UriKind.RelativeOrAbsolute, out uri))
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (1)
1802if (Uri.TryCreate(dataContractNs, UriKind.RelativeOrAbsolute, out uri))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataLocation.cs (1)
32if (!Uri.TryCreate(value, UriKind.RelativeOrAbsolute, out uri))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceMetadataExtension.cs (1)
238else if (Uri.TryCreate(text, UriKind.Absolute, out uri))
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\ServiceReflector.cs (2)
156if (!Uri.TryCreate(ns, UriKind.RelativeOrAbsolute, out uri)) 163if (!Uri.TryCreate(ns, UriKind.RelativeOrAbsolute, out uri))
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (2)
897if (!Uri.TryCreate(address, UriKind.Absolute, out uri)) 964if (!Uri.TryCreate(address, UriKind.Absolute, out uri))
Metadata\MetadataDocumentLoader.cs (7)
269if (Uri.TryCreate(uri, UriKind.Absolute, out serviceUri) || 270isUrl && Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri baseUri) && Uri.TryCreate(baseUri, uri, out serviceUri) || 271!isUrl && Uri.TryCreate(Path.Combine(basePath, uri), UriKind.Absolute, out serviceUri)) 480if (Uri.TryCreate(schemaLocation, UriKind.Absolute, out schemaUri)) 490if (Uri.TryCreate(Path.Combine(basePath, schemaLocation), UriKind.Absolute, out Uri schemaFile)) 498if (schemaUri == null && Uri.TryCreate(baseUrl, UriKind.Absolute, out Uri baseUri)) 557Uri.TryCreate(fullFileName, UriKind.Absolute, out schemaFile);
Metadata\MetadataDocumentSaver.cs (1)
302Uri.TryCreate(location, UriKind.Absolute, out Uri uri);
Metadata\MetadataFileNameManager.cs (7)
104if (Uri.TryCreate(ns, UriKind.RelativeOrAbsolute, out Uri nsUri)) 200if (Uri.TryCreate(filePath1, UriKind.Absolute, out fileUri) || Uri.TryCreate(filePath1, UriKind.Relative, out fileUri)) 211return Uri.TryCreate(filePath1, UriKind.Absolute, out uri1) && Uri.TryCreate(filePath2, UriKind.Absolute, out uri2) && StringComparer.OrdinalIgnoreCase.Compare(uri1.AbsoluteUri, uri2.AbsoluteUri) == 0 || 212Uri.TryCreate(filePath1, UriKind.Relative, out uri1) && Uri.TryCreate(filePath2, UriKind.Relative, out uri2) && StringComparer.OrdinalIgnoreCase.Compare(uri1.ToString(), uri2.ToString()) == 0;
OutputPathHelper.cs (1)
116if (Uri.TryCreate(ns, UriKind.RelativeOrAbsolute, out Uri nsUri))
Shared\Utilities\PathHelper.cs (1)
61if (!isUrl && (Uri.TryCreate(Path.Combine(basePath, input), UriKind.Absolute, out var uri)) && uri.Scheme == "file")
GenerateRulesMissingDocumentation (1)
Program.cs (1)
108if (!Uri.TryCreate(helpLink, UriKind.Absolute, out var uri))
Microsoft.AspNetCore.Authentication.WsFederation (1)
WsFederationPostConfigureOptions.cs (1)
52if (!options.CallbackPath.HasValue && !string.IsNullOrEmpty(options.Wreply) && Uri.TryCreate(options.Wreply, UriKind.Absolute, out var wreply))
Microsoft.AspNetCore.Components.Endpoints (2)
FormMapping\Converters\UriFormDataConverter.cs (1)
15if (Uri.TryCreate(value, UriKind.RelativeOrAbsolute, out result!))
Rendering\EndpointHtmlRenderer.Prerendering.cs (1)
229if (!Uri.TryCreate(destinationUrl, UriKind.Absolute, out var absoluteUri))
Microsoft.AspNetCore.Components.Server (2)
ComponentHub.cs (2)
98!Uri.TryCreate(baseUri, UriKind.Absolute, out _) || 99!Uri.TryCreate(uri, UriKind.Absolute, out _))
Microsoft.AspNetCore.Components.WebView.WindowsForms (2)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
345 if (Uri.TryCreate(args.Uri, UriKind.RelativeOrAbsolute, out var uri)) 369 if (Uri.TryCreate(args.Uri, UriKind.RelativeOrAbsolute, out var uri))
Microsoft.AspNetCore.Components.WebView.Wpf (2)
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
345 if (Uri.TryCreate(args.Uri, UriKind.RelativeOrAbsolute, out var uri)) 369 if (Uri.TryCreate(args.Uri, UriKind.RelativeOrAbsolute, out var uri))
Microsoft.AspNetCore.Cors (2)
Infrastructure\CorsPolicyBuilder.cs (1)
71if (Uri.TryCreate(origin, UriKind.Absolute, out var uri) &&
Infrastructure\CorsPolicyExtensions.cs (1)
19if (Uri.TryCreate(origin, UriKind.Absolute, out var originUri))
Microsoft.AspNetCore.HeaderParsing (1)
Parsers\UriParser.cs (1)
16if (values.Count != 1 || !Uri.TryCreate(values[0], UriKind.RelativeOrAbsolute, out var parsedValue))
Microsoft.AspNetCore.Http.Extensions (3)
RequestHeaders.cs (1)
338if (Uri.TryCreate(Headers.Referer, UriKind.RelativeOrAbsolute, out var uri))
ResponseHeaders.cs (1)
173if (Uri.TryCreate(Headers.Location, UriKind.RelativeOrAbsolute, out var uri))
src\Components\Endpoints\src\FormMapping\Converters\UriFormDataConverter.cs (1)
15if (Uri.TryCreate(value, UriKind.RelativeOrAbsolute, out result!))
Microsoft.AspNetCore.Http.Extensions.Tests (21)
RequestDelegateFactoryTests.cs (10)
402if (!Uri.TryCreate(value, UriKind.Absolute, out var uri)) 420if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 441if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 457if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 480if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 498if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 514if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 533if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 546if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 564if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri))
RequestDelegateGenerator\SharedTypes.cs (11)
146if (!Uri.TryCreate(value, UriKind.Absolute, out var uri)) 226if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 253if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 278if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 305if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 322if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 338if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 359if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 392if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 426if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 450if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri))
Microsoft.AspNetCore.Http.Microbenchmarks (11)
src\Http\Http.Extensions\test\RequestDelegateGenerator\SharedTypes.cs (11)
146if (!Uri.TryCreate(value, UriKind.Absolute, out var uri)) 226if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 253if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 278if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 305if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 322if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 338if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 359if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 392if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 426if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri)) 450if (!Uri.TryCreate(context.Request.Headers.Referer, UriKind.Absolute, out var uri))
Microsoft.AspNetCore.Mvc.Razor (1)
Infrastructure\DefaultFileVersionProvider.cs (1)
48if (Uri.TryCreate(resolvedPath, UriKind.Absolute, out var uri) && !uri.IsFile)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\Http1Connection.cs (1)
562if (!Uri.TryCreate(RawTarget, UriKind.Absolute, out var uri))
Microsoft.Authentication.WebAssembly.Msal (2)
MsalDefaultOptionsConfiguration.cs (2)
26if (redirectUri == null || !Uri.TryCreate(redirectUri, UriKind.Absolute, out _)) 34if (logoutUri == null || !Uri.TryCreate(logoutUri, UriKind.Absolute, out _))
Microsoft.Build (3)
Construction\Solution\ProjectInSolution.cs (1)
183if (!Uri.TryCreate(_relativePath, UriKind.Absolute, out Uri _))
Construction\Solution\SolutionFile.cs (1)
817if (Uri.TryCreate(proj.RelativePath, UriKind.Absolute, out Uri uri))
ElementLocation\XmlDocumentWithLocation.cs (1)
132if (Uri.TryCreate(reader.BaseURI, UriKind.RelativeOrAbsolute, out Uri uri))
Microsoft.Build.Tasks.Core (3)
DownloadFile.cs (1)
88if (!Uri.TryCreate(SourceUrl, UriKind.Absolute, out Uri uri))
ManifestUtil\PathUtil.cs (2)
184if (!Uri.TryCreate(path, UriKind.Absolute, out u) || u == null) 194if (!Uri.TryCreate(path, UriKind.Absolute, out Uri u) || u == null)
Microsoft.CodeAnalysis (2)
CommandLine\SarifErrorLogger.cs (2)
138if (Uri.TryCreate(fullPath, UriKind.Absolute, out var uri)) 155if (Uri.TryCreate(path, UriKind.Relative, out var uri))
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
256=> Uri.TryCreate(descriptor.HelpLinkUri, UriKind.Absolute, out var uri) &&
Microsoft.CodeAnalysis.EditorFeatures (1)
IntelliSense\NavigationActionFactory.cs (1)
35if (Uri.TryCreate(navigationTarget, UriKind.Absolute, out var absoluteUri))
Microsoft.CodeAnalysis.Features (1)
AddImport\PackageSourceHelper.cs (1)
40if (!Uri.TryCreate(sourceUrl, UriKind.Absolute, out var uri))
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (1)
256=> Uri.TryCreate(descriptor.HelpLinkUri, UriKind.Absolute, out var uri) &&
Microsoft.DotNet.Build.Tasks.Feed (1)
src\BuildModelFactory.cs (1)
276if (Uri.TryCreate(repoUri, UriKind.Absolute, out Uri parsedUri))
Microsoft.DotNet.Git.IssueManager (3)
Helpers\RepositoryHelper.cs (3)
19if (Uri.TryCreate(repositoryUrl, UriKind.Absolute, out Uri parsedUri)) 51if (Uri.TryCreate(repositoryUrl, UriKind.Absolute, out Uri parsedUri)) 82if (Uri.TryCreate(repositoryUrl, UriKind.Absolute, out Uri parsedUri))
Microsoft.DotNet.SignCheck (1)
SignCheck.cs (1)
203if ((Uri.TryCreate(inputFile, UriKind.Absolute, out uriResult)) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps))
Microsoft.Extensions.DependencyModel (1)
DependencyContextLoader.cs (1)
161if (Uri.TryCreate(assembly.CodeBase, UriKind.Absolute, out Uri? codeBase)
Microsoft.Extensions.ServiceDiscovery (4)
Configuration\ConfigurationServiceEndpointProvider.cs (2)
204if (value.IndexOf("://") < 0 && Uri.TryCreate($"fakescheme://{value}", default, out var uri)) 216else if (Uri.TryCreate(value, default, out uri))
PassThrough\PassThroughServiceEndpointProviderFactory.cs (2)
31if ((serviceName.Contains("://", StringComparison.Ordinal) || !Uri.TryCreate($"fakescheme://{serviceName}", default, out var uri)) && !Uri.TryCreate(serviceName, default, out uri))
Microsoft.Extensions.ServiceDiscovery.Abstractions (2)
ServiceEndpointQuery.cs (2)
40&& Uri.TryCreate($"fakescheme://{input}", default, out var uri)) 44else if (Uri.TryCreate(input, default, out uri))
Microsoft.Maui (1)
Handlers\WebView\WebViewHandler.iOS.cs (1)
488 if (Uri.TryCreate(url, UriKind.Absolute, out uri))
Microsoft.Maui.Controls (3)
ImageSource.cs (1)
111 return Uri.TryCreate(source, UriKind.Absolute, out uri) && uri.Scheme != "file" ? FromUri(uri) : FromFile(source);
ImageSourceConverter.cs (1)
29 return Uri.TryCreate(strValue, UriKind.Absolute, out Uri uri) && uri.Scheme != "file" ? ImageSource.FromUri(uri) : ImageSource.FromFile(strValue);
Shell\ShellUriHandler.cs (1)
98 if (Uri.TryCreate(path, UriKind.Absolute, out Uri result))
Microsoft.Maui.Controls.Build.Tasks (2)
CompiledConverters\ImageSourceTypeConverter.cs (1)
18 if (Uri.TryCreate(value, UriKind.Absolute, out Uri uri) && uri.Scheme != "file")
CreateObjectVisitor.cs (1)
547 if (hasValue && Uri.TryCreate(valueString, UriKind.RelativeOrAbsolute, out _))
Microsoft.Maui.Controls.Compatibility (1)
iOS\Renderers\WkWebViewRenderer.cs (1)
320 if (Uri.TryCreate(url, UriKind.Absolute, out uri))
Microsoft.Maui.Controls.DesignTools (1)
ImageSourceDesignTypeConverter.cs (1)
13 return Uri.TryCreate(strValue, UriKind.RelativeOrAbsolute, out Uri _);
Microsoft.Maui.Controls.Xaml (1)
CreateValuesVisitor.cs (1)
379 if (nodeType == typeof(Uri) && Uri.TryCreate(valuestring, UriKind.RelativeOrAbsolute, out Uri urival))
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
114if (!Uri.TryCreate(Path.Combine(MlNetResourcesUrl, relativeUrl), UriKind.Absolute, out var absoluteUrl))
Microsoft.ML.Core.Tests (2)
UnitTests\TestResourceDownload.cs (2)
43if (!Uri.TryCreate("https://fake-website/fake-model.model/", UriKind.Absolute, out var badUri)) 73if (!Uri.TryCreate("https://cnn.com/", UriKind.Absolute, out var cnn))
Microsoft.VisualStudio.LanguageServices (3)
Progression\GraphBuilder.cs (2)
696if (!Uri.TryCreate(fileName, UriKind.RelativeOrAbsolute, out _)) 786if (!Uri.TryCreate(path, UriKind.Absolute, out var uri))
ProjectSystem\MetadataReferences\VisualStudioFrameworkAssemblyPathResolverFactory.cs (1)
57if (Uri.TryCreate(assembly.CodeBase, UriKind.RelativeOrAbsolute, out var uri) &&
Microsoft.VisualStudio.LanguageServices.Xaml (1)
Features\Diagnostics\XamlDiagnostic.cs (1)
23=> Uri.TryCreate(HelpLink, UriKind.Absolute, out var uri) ? uri : null;
MSBuild (1)
TerminalLogger\TerminalLogger.cs (1)
646if (Uri.TryCreate(urlString, UriKind.Absolute, out Uri? uri))
PresentationCore (3)
MS\Internal\FontCache\CanonicalFontFamilyReference.cs (1)
45if (Uri.TryCreate(locationString, UriKind.Absolute, out absoluteUri))
System\Windows\Media\ColorContext.cs (1)
557if (!Uri.TryCreate(profilePathString, UriKind.Absolute, out profilePath))
System\Windows\Media\Fonts.cs (1)
89if (!string.IsNullOrEmpty(location) && Uri.TryCreate(location, UriKind.Absolute, out fontLocation))
PresentationFramework (1)
System\Windows\SystemResources.cs (1)
954if (Uri.TryCreate(packUri, UriKind.Absolute, out streamUri))
System.ComponentModel.TypeConverter (1)
System\ComponentModel\UriTypeConverter.cs (1)
96return Uri.TryCreate(text, UriKind.RelativeOrAbsolute, out _);
System.Configuration.ConfigurationManager (1)
System\Configuration\ClientConfigPaths.cs (1)
263else if (Uri.TryCreate(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, assembly.ManifestModule.Name), UriKind.Absolute, out Uri codeBase))
System.Diagnostics.Process (1)
System\Diagnostics\Process.Unix.cs (1)
643else if (Uri.TryCreate(filename, UriKind.Absolute, out Uri? uri))
System.IO.Packaging (1)
System\IO\Packaging\ZipPackagePartPiece.cs (1)
136&& Uri.TryCreate(ZipPackage.GetOpcNameFromZipItemName(prefixName), UriKind.Relative, out Uri? unvalidatedPartUri)
System.Net.Http (4)
System\Net\Http\Headers\UriHeaderParser.cs (2)
42if (!Uri.TryCreate(uriString, _uriKind, out Uri? uri)) 47if (!Uri.TryCreate(uriString, _uriKind, out uri))
System\Net\Http\HttpRuleParser.cs (1)
307return Uri.TryCreate($"http://u@{host}/", UriKind.Absolute, out _);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (1)
261if ((proxyType & wantedFlag) != 0 && Uri.TryCreate(string.Concat("http://", proxyString.Slice(0, iter)), UriKind.Absolute, out uri))
System.Net.HttpListener (7)
src\libraries\Common\src\System\Net\CookieParser.cs (1)
628if (Uri.TryCreate(CheckQuoted(_tokenizer.Value), UriKind.Absolute, out Uri? parsed))
System\Net\HttpListenerRequest.cs (1)
221bool success = Uri.TryCreate(referrer, UriKind.RelativeOrAbsolute, out Uri? urlReferrer);
System\Net\HttpListenerRequestUriBuilder.cs (2)
84bool isValid = Uri.TryCreate(_cookedUriScheme + Uri.SchemeDelimiter + _cookedUriHost + _cookedUriPath + 153if (!Uri.TryCreate(_requestUriString.ToString(), UriKind.Absolute, out _requestUri))
System\Net\Managed\HttpListenerRequest.Managed.cs (2)
153if (MaybeUri(_rawUrl!.ToLowerInvariant()) && Uri.TryCreate(_rawUrl, UriKind.Absolute, out raw_uri)) 170if (!Uri.TryCreate(base_uri + path, UriKind.Absolute, out _requestUri))
System\Net\ServiceNameStore.cs (1)
102if (!Uri.TryCreate(Uri.UriSchemeHttp + Uri.SchemeDelimiter + host, UriKind.Absolute, out constructedUri))
System.Net.Mail (1)
System\Net\Mail\Attachment.cs (1)
262if (!Uri.TryCreate(_part.ContentLocation, UriKind.RelativeOrAbsolute, out uri))
System.Net.Primitives (2)
src\libraries\Common\src\System\Net\CookieParser.cs (1)
628if (Uri.TryCreate(CheckQuoted(_tokenizer.Value), UriKind.Absolute, out Uri? parsed))
System\Net\CookieContainer.cs (1)
250if (!Uri.TryCreate(uriSb.ToString(), UriKind.Absolute, out uri))
System.Net.Requests (2)
System\Net\HttpWebRequest.cs (1)
1628return Uri.TryCreate(s, UriKind.Absolute, out hostUri);
System\Net\WebRequest.cs (1)
252if (Uri.TryCreate(prefix, UriKind.Absolute, out Uri? tempUri))
System.Net.Security (2)
System\Net\Security\SslStreamCertificateContext.Linux.cs (1)
222if (Uri.TryCreate(entry, UriKind.Absolute, out Uri? uri))
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (1)
245if (!Uri.TryCreate(string.Concat(HttpSchemeAndDelimiter, host), UriKind.Absolute, out constructedUri))
System.Net.WebClient (1)
System\Net\WebClient.cs (1)
790else if (!Uri.TryCreate(address, UriKind.Absolute, out uri))
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\DataContract.cs (1)
1657if (Uri.TryCreate(dataContractNs, UriKind.RelativeOrAbsolute, out Uri? uri))
System.Private.Uri (3)
System\Uri.cs (1)
1706if (!TryCreate(s, UriKind.RelativeOrAbsolute, out other))
System\UriExt.cs (2)
305if (TryCreate(relativeUri, UriKind.RelativeOrAbsolute, out Uri? relativeLink)) 425if (!Uri.TryCreate(uriString, uriKind, out result))
System.Private.Xml (4)
System\Xml\XmlConvert.cs (2)
1319if (!Uri.TryCreate(s, UriKind.RelativeOrAbsolute, out uri)) 1339if (!Uri.TryCreate(s, UriKind.RelativeOrAbsolute, out result))
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
173if (!Uri.TryCreate(collationLiteral, UriKind.Absolute, out collationUri))
System\Xml\Xsl\SourceLineInfo.cs (1)
88System.Uri.TryCreate(uriString, UriKind.Absolute, out uri) &&
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
1517if (Uri.TryCreate(dataContractNamespace, UriKind.RelativeOrAbsolute, out Uri? uri))
System.Security.Cryptography (2)
System\Security\Cryptography\X509Certificates\OpenSslCrlCache.cs (1)
344if (Uri.TryCreate(name.Uri, UriKind.Absolute, out Uri? uri) &&
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (1)
1246if (Uri.TryCreate(name.Uri, UriKind.Absolute, out Uri? uri) &&
System.Text.Json (1)
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
38if (!Uri.TryCreate(uriString, UriKind.RelativeOrAbsolute, out Uri? value))
System.Web.HttpUtility (1)
System\Web\Util\UriUtil.cs (1)
33if (Uri.TryCreate(inputWithoutQueryFragment, UriKind.Absolute, out Uri? uri))
System.Xaml (1)
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\Replacements\TypeUriConverter.cs (1)
96return Uri.TryCreate(uriString, UriKind.RelativeOrAbsolute, out _);