1102 references to new
ActivityGenerator (1)
Program.cs (1)
13client.BaseAddress = new Uri($"https+http://{resource}");
AnalyzeCiFailure (1)
tools\Aspire.TestTools\GitHubApiClient.cs (1)
87return new GitHubApiClient(http, GetDefaultTokenAsync, new Uri("https://api.github.com/")) { _ownsHttpClient = true };
AnalyzeCiFailure.TestHost (1)
CommandHost.cs (1)
17() => new GitHubApiClient(http, _ => Task.FromResult("fixture-token"), new Uri("https://api.github.com/")));
AnalyzeCiFailure.Tests (9)
AnalyzeCiFailureGitTests.cs (1)
225["--no-pager", "remote", "add", "origin", new Uri(remoteDirectory).AbsoluteUri],
AnalyzeCiFailurePreparationTests.cs (1)
492"external-entity" => $"""<!DOCTYPE TestRun [<!ENTITY external SYSTEM "{new Uri(secret).AbsoluteUri}">]><TestRun><Results>&external;</Results></TestRun>""",
AnalyzeCiFailureWorkflowTests.cs (1)
5268new Uri("https://api.github.com/"));
GitHubApiClientTests.cs (6)
15private static readonly Uri s_api = new("https://api.github.com/"); 586redirect.Headers.Location = new Uri("https://blob.invalid/log?signature=secret"); 611response.Headers.Location = new Uri("https://blob.invalid/private?signature=secret"); 633response.Headers.Location = new Uri(target); 652response.Headers.Location = new Uri($"https://blob.invalid/log/{calls}?signature=secret"); 681response.Headers.Location = new Uri("https://blob.invalid/private?signature=secret");
aspire (3)
Documentation\ApiDocs\ApiDocsSourceConfiguration.cs (1)
173var siteRootUri = new Uri(sitemapUri.GetLeftPart(UriPartial.Authority));
Projects\DotNetBasedAppHostServerProject.cs (1)
109appPath = new Uri(Path.GetFullPath(appPath)).LocalPath;
Utils\MarkupHelpers.cs (1)
100var fileUri = new Uri(Path.GetFullPath(filePath)).AbsoluteUri;
aspire-tray (1)
TrayApplication.Actions.cs (1)
79OpenUrl(new Uri("https://aspire.dev"));
Aspire.Azure.AI.Extensions.OpenAI.Tests (22)
AspireAzureOpenAIExtensionsTests.cs (9)
70Assert.Equal(new Uri(Endpoint + "/openai/v1/"), client.Endpoint); 110Assert.Equal(new Uri(Endpoint), settings.Endpoint); 111settings.Endpoint = new("https://callback.openai.azure.com"); 141Assert.Equal(new Uri("https://callback.openai.azure.com/openai/v1/chat/completions"), request.Uri); 217settings.Endpoint = new(Endpoint); 320client.ConfigureOptions(options => options.Endpoint = new("http://test.openai.azure.com")); 349settings.Endpoint = new(endpoint); 370builder.AddKeyedAzureOpenAIClient("account", settings => settings.Endpoint = new(Endpoint)); 371builder.AddKeyedAzureProjectOpenAIClient("project", settings => settings.Endpoint = new("https://test.services.ai.azure.com/api/projects/test"));
AspireAzureProjectOpenAIExtensionsTests.cs (10)
118Assert.Equal(new Uri(Endpoint), settings.Endpoint); 119settings.Endpoint = new("https://callback.services.ai.azure.com/api/projects/callback"); 173builder.AddKeyedAzureProjectOpenAIClient("project", settings => settings.Endpoint = new(Endpoint)); 177builder.AddAzureProjectOpenAIClient("project", settings => settings.Endpoint = new(Endpoint)); 240var endpoint = new Uri("http://test.services.ai.azure.com/api/projects/test"); 276builder.AddKeyedAzureProjectOpenAIClient("first", settings => settings.Endpoint = new(Endpoint)); 277builder.AddKeyedAzureProjectOpenAIClient("second", settings => settings.Endpoint = new(Endpoint)); 327settings.Endpoint = new(Endpoint); 347settings.Endpoint = new("https://example.invalid/v1"); 447settings.Endpoint = new(Endpoint);
AspireConfigurableOpenAIExtensionsTests.cs (3)
47Assert.Equal(new Uri(endpoint), client.Endpoint); 117Assert.Equal(new Uri("https://api.openai.com/v1"), Resolve(host.Services, keyed).Endpoint); 175Assert.Equal(new Uri(endpoint), request.Uri);
Aspire.Azure.AI.Projects.Tests (8)
AspireAzureAIProjectsExtensionsTests.cs (8)
121var finalEndpoint = new Uri("https://callback.services.ai.azure.com/api/projects/callback"); 125Assert.Equal(new Uri(Endpoint), settings.Endpoint); 170builder.AddKeyedAzureAIProjectClient("project", settings => settings.Endpoint = new(Endpoint)); 174builder.AddAzureAIProjectClient("project", settings => settings.Endpoint = new(Endpoint)); 209var endpoint = new Uri("http://test.services.ai.azure.com/api/projects/test"); 245builder.AddKeyedAzureAIProjectClient("first", settings => settings.Endpoint = new(Endpoint)); 246builder.AddKeyedAzureAIProjectClient("second", settings => settings.Endpoint = new(Endpoint)); 263settings.Endpoint = new(Endpoint);
Aspire.Azure.Data.Tables.Tests (1)
ConformanceTests.cs (1)
138TableServiceClient tableClient = new(new Uri(ServiceUri), new DefaultAzureCredential(), clientOptions);
Aspire.Azure.Messaging.EventHubs (1)
EventHubsComponent.cs (1)
95: new Uri(settings.FullyQualifiedNamespace).Host;
Aspire.Azure.Messaging.EventHubs.Tests (2)
AspireEventHubsExtensionsTests.cs (2)
62var blobClient = new BlobServiceClient(new Uri(BlobsConnectionString), new DefaultAzureCredential()); 617var blobClient = new BlobServiceClient(new Uri(BlobsConnectionString), new BlobClientOptions() { Transport = mockTransport });
Aspire.Azure.Messaging.WebPubSub (1)
AzureMessagingWebPubSubSettings.cs (1)
78Endpoint = new Uri(endpoint.ToString()!);
Aspire.Azure.Search.Documents.Tests (5)
AspireAzureSearchExtensionsTests.cs (5)
47Assert.Equal(new Uri(SearchEndpoint), client.Endpoint); 55var searchEndpoint = new Uri("https://aspireazuresearchtests.search.windows.net/"); 74Assert.Equal(new Uri(SearchEndpoint), client.Endpoint); 103Assert.Equal(new Uri("https://aspireazuresearchtests2.search.windows.net/"), client2.Endpoint); 104Assert.Equal(new Uri("https://aspireazuresearchtests3.search.windows.net/"), client3.Endpoint);
Aspire.Azure.Security.KeyVault.Tests (11)
AspireKeyVaultExtensionsTests.cs (8)
24var vaultUri = new Uri(ConformanceConstants.VaultUri); 77Assert.Equal(new Uri(ConformanceConstants.VaultUri), client.VaultUri); 207Assert.Equal(new Uri("https://aspiretests2.vault.azure.net/"), client2.VaultUri); 208Assert.Equal(new Uri("https://aspiretests3.vault.azure.net/"), client3.VaultUri); 232var vaultUri = new Uri(ConformanceConstants.VaultUri); 272Assert.Equal(secretClient.VaultUri, new Uri(secretClientUri)); 273Assert.Equal(keyClient.VaultUri, new Uri(keyClientUri)); 274Assert.Equal(certClient.VaultUri, new Uri(certClientUri));
CertificateClientConformanceTests.cs (1)
125CertificateClient certClient = new(new Uri(VaultUri), new DefaultAzureCredential(), clientOptions);
KeyClientConformanceTests.cs (1)
127KeyClient keyClient = new(new Uri(VaultUri), new DefaultAzureCredential(), clientOptions);
SecretClientConformanceTests.cs (1)
126SecretClient secretClient = new(new Uri(VaultUri), new DefaultAzureCredential(), clientOptions);
Aspire.Azure.Storage.Blobs.Tests (1)
ConformanceTests.cs (1)
142BlobServiceClient tableClient = new(new Uri(ServiceUri), new DefaultAzureCredential(), clientOptions);
Aspire.Azure.Storage.Files.DataLake.Tests (1)
ConformanceTests.cs (1)
146DataLakeServiceClient tableClient = new(new Uri(ServiceUri), new DefaultAzureCredential(), clientOptions);
Aspire.Azure.Storage.Queues.Tests (1)
ConformanceTests.cs (1)
147QueueServiceClient tableClient = new(new Uri(ServiceUri), new DefaultAzureCredential(), clientOptions);
Aspire.Cli.Tests (27)
Commands\DashboardRunCommandTests.cs (1)
676var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
Commands\NewCommandLocalTemplateTests.ConfiguredGitSourceObjects.cs (1)
360var fixtureUrl = new Uri(repository.FullName).AbsoluteUri;
Commands\NewCommandLocalTemplateTests.ConfiguredGitSources.cs (1)
524var fixtureUrl = new Uri(repository.FullName).AbsoluteUri;
Commands\NewCommandLocalTemplateTests.cs (1)
1409List<string> arguments = ["new", "--template-repository", new Uri(repository.FullName).AbsoluteUri,
Commands\NewCommandLocalTemplateTests.HostConfiguration.cs (2)
459Assert.InRange(new Uri(url).Port, 1024, 65535); 465Assert.InRange(new Uri(variable.Value.GetString()!).Port, 1024, 65535);
Commands\NewCommandLocalTemplateTests.SourceListGit.cs (1)
251var fixtureUrl = new Uri(templates.FullName).AbsoluteUri;
Commands\PsCommandTests.cs (1)
393var expectedDashboardUrl = new Uri("http://localhost:18888/login?t=abc123").AbsoluteUri;
Commands\RunCommandTests.cs (1)
3156var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
Interaction\ConsoleInteractionServiceTests.cs (2)
1339var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri; 1364var fileUri = new Uri(Path.GetFullPath(logFilePath)).AbsoluteUri;
Mcp\McpToolHelpersTests.cs (2)
208var apiBaseUri = new Uri(apiBaseUrl); 213var resourcesUri = new Uri(DashboardUrls.TelemetryResourcesApiUrl(apiBaseUrl));
NuGet\NuGetClientTests.cs (1)
1718var source = useFileUri ? new Uri(hive.FullName).AbsoluteUri : hive.FullName;
Packaging\PackageChannelTests.cs (1)
1095new PackageMapping("Aspire*", new Uri(packagesDirectory.FullName).AbsoluteUri),
Packaging\PackageSourceIdentityTests.cs (1)
111var fileUri = new Uri(feed.FullName).AbsoluteUri;
Packaging\PackageSourceOverrideMappingsTests.cs (1)
148var fileUri = new Uri(source).AbsoluteUri;
Projects\AppHostServerProjectTests.cs (1)
405normalizedAppPath = new Uri(normalizedAppPath).LocalPath;
Projects\PrebuiltAppHostServerTests.cs (1)
2760var packageSourceUri = new Uri(packageSource.FullName).AbsoluteUri;
Templating\TemplateNuGetConfigServiceTests.cs (1)
1279[new PackageMapping("Aspire*", new Uri(packagesDir.FullName).AbsoluteUri)],
Templating\TemplatePackageLockTests.cs (2)
138.Select(package => new Uri(package.Value.GetProperty("resolved").GetString()!).Host) 251.Select(package => new Uri(package.Value.GetProperty("resolved").GetString()!).Host)
Utils\DcpConnectionHealthCheckTests.cs (2)
249Assert.Equal(new Uri("https://127.0.0.1:12345"), parsed.Server); 280Assert.Equal(new Uri("https://127.0.0.1:12345"), parsed.Server);
Utils\MarkupHelpersTests.cs (3)
125var expectedUri = new Uri(Path.GetFullPath(path)).AbsoluteUri; 136var expectedUri = new Uri(Path.GetFullPath(path)).AbsoluteUri; 151var fileUri = new Uri(Path.GetFullPath(path)).AbsoluteUri;
Aspire.Components.Common.TestUtilities (2)
ComponentTestUrls.cs (2)
12=> new($"http://127.0.0.1:{GetUnusedTcpPort()}"); 15=> new($"https://127.0.0.1:{GetUnusedTcpPort()}");
Aspire.Dashboard (16)
Components\Controls\TerminalView.razor.cs (5)
209return new Uri(new Uri(NavigationManager.BaseUri), EndpointPathAndQuery).PathAndQuery; 216return new Uri(new Uri(NavigationManager.BaseUri), 227var moduleUri = new Uri(new Uri(NavigationManager.BaseUri), Assets["Components/Controls/TerminalView.razor.js"]); 294newEndpoint = new Uri(new Uri(NavigationManager.BaseUri), newEndpoint).PathAndQuery; 446var endpoint = new Uri(new Uri(NavigationManager.BaseUri), pathAndQuery);
Components\Dialogs\SettingsDialog.razor.cs (2)
140var uri = new Uri(NavigationManager.Uri) 189var uri = new Uri(NavigationManager.Uri)
Components\Layout\ResourcesLayout.razor.cs (1)
2059var location = new Uri(NavigationManager.Uri);
Components\Legacy\Dialogs\LegacySettingsDialog.razor.cs (2)
81var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped); 101var uri = new Uri(NavigationManager.Uri).GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped);
Components\Legacy\Pages\TerminalWindow.razor.cs (1)
166var moduleUri = new Uri(new Uri(NavigationManager.BaseUri), Assets["js/app-terminalwindow.js"]);
Components\Pages\Terminals.razor.cs (1)
241var location = new Uri(NavigationManager.Uri);
Components\Pages\TerminalWindow.razor.cs (1)
166var moduleUri = new Uri(new Uri(NavigationManager.BaseUri), Assets["js/app-terminalwindow.js"]);
Model\TargetLocationInterceptor.cs (2)
64var targetBaseUri = new Uri(uri.GetLeftPart(UriPartial.Authority)); 65if (targetBaseUri != new Uri(appBaseUri))
Model\TerminalWindowLauncher.cs (1)
117var moduleUri = new Uri(new Uri(_navigationManager.BaseUri), _modulePath);
Aspire.Dashboard.Components.Tests (24)
Controls\TerminalViewTests.cs (2)
58Assert.True(registry.TryGet(viewId, new Uri(Assert.IsType<string>(invocation.Arguments[1])).PathAndQuery, out _)); 1004var secondUrl = new Uri(Assert.IsType<string>(Assert.Single(module.Invocations, i => i.Identifier == "reconnectTerminal").Arguments[1]));
Dialogs\DashboardFeedbackTests.cs (1)
106var discussionUrl = new Uri(Assert.IsType<string>(invocation.Arguments[1]));
Dialogs\HelpDialogTests.cs (1)
142Assert.Equal("/resources", new Uri(Services.GetRequiredService<NavigationManager>().Uri).AbsolutePath);
Layout\ResourceRowAvailabilityTests.cs (1)
256urls: [new("tcp", new Uri("tcp://localhost:6379"), false, false, UrlDisplayPropertiesViewModel.Empty)])],
Layout\ResourcesLayoutActivityTests.cs (2)
278var url = new Uri(new Uri("http://localhost"), cut.Find(".resource-row-insight-requests").GetAttribute("href")); 378var url = new Uri(new Uri("http://localhost"), link.GetAttribute("href"));
Layout\ResourcesLayoutTests.cs (7)
86new Uri(navigation.Uri).PathAndQuery); 132Assert.Equal(appHostEnabled ? DashboardUrls.ResourceListUrl() : DashboardUrls.StructuredLogsUrl(), new Uri(navigation.Uri).PathAndQuery); 471new("https", new Uri(address), false, false, new("Friendly API", 0)), 472new("tcp", new Uri(tcpAddress), false, false, UrlDisplayPropertiesViewModel.Empty), 473new("internal", new Uri("https://internal.test"), true, false, UrlDisplayPropertiesViewModel.Empty), 474new("inactive", new Uri("https://inactive.test"), false, true, UrlDisplayPropertiesViewModel.Empty) 1826urls: [new UrlViewModel("https", new Uri("https://localhost:5001"), false, false, UrlDisplayPropertiesViewModel.Empty)],
Pages\MetricsTests.cs (1)
939loadRedirect = new Uri(a.Location);
Pages\ResourceOverviewEmptyPanelsTests.cs (1)
164urls: [new("http", new Uri("http://localhost:5000"), false, false, UrlDisplayPropertiesViewModel.Empty)],
Pages\ResourceOverviewEndpointTests.cs (5)
34new("public", new Uri(original), false, false, new("Catalog API", 5)), 35new("public", new Uri(original), true, false, new("Catalog API", 5)), 36new("plain", new Uri(original), false, false, UrlDisplayPropertiesViewModel.Empty), 37new(null, new Uri(original), false, false, new("Documentation", 0)), 38new("same", new Uri(original), false, false, new("same", 0))
Pages\TerminalsTests.cs (1)
770navigation.NavigateTo(new Uri(new Uri(navigation.BaseUri), DashboardUrls.TerminalsUrl(resourceName).TrimStart('/')).AbsoluteUri);
Shared\TerminalSetupHelpers.cs (2)
142viewId, new Uri(expectedWebSocketUrl).PathAndQuery, out _)); 147var uri = new Uri(Assert.IsType<string>(webSocketUrl));
Aspire.Dashboard.Playwright.Tests (34)
Integration\Playwright\BrowserTokenAuthenticationTests.cs (8)
55var uri = new Uri(response!.Url); 65await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == "/resources").DefaultTimeout(); 84var uri = new Uri(response!.Url); 94await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == "/resources").DefaultTimeout(); 113var uri = new Uri(response!.Url); 195Assert.Equal("/", new Uri(firstResponse!.Url).AbsolutePath); 198Assert.Equal(canAccessBoth ? "/" : "/login", new Uri(secondResponse!.Url).AbsolutePath); 288Assert.Equal("/structuredlogs", new Uri(page.Url).AbsolutePath);
Integration\Playwright\DashboardExperienceTests.cs (2)
84await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == "/legacy/consolelogs"); 96await page.WaitForURLAsync(url => new Uri(url).AbsolutePath == expectedPath);
Integration\Playwright\DashboardInteractionsTests.cs (1)
893new UrlViewModel("http", new Uri("about:blank#parent-url"), isInternal: false, isInactive: false, UrlDisplayPropertiesViewModel.Empty)
Integration\Playwright\DesktopNavMenuTests.cs (1)
29await page.WaitForURLAsync(url => new Uri(url).AbsolutePath.StartsWith("/resources", StringComparison.Ordinal));
Integration\Playwright\Infrastructure\ResourcePaneNavigation.cs (1)
30var destination = isFullCanvas ? null : new Uri(new Uri(page.Url),
Integration\Playwright\NativeAotDashboardTests.cs (1)
152using var client = new HttpClient { BaseAddress = new Uri(otlpUrl) };
Integration\Playwright\ResourceOverviewEndpointTests.cs (6)
158new("https", new Uri(PublicUrl), false, false, new("Catalog API", 5)), 159new("https", new Uri(InternalUrl), true, false, new("Catalog API", 5)), 160new("openapi", new Uri(s_longUrl), false, false, new(s_longFriendlyName, 4)), 161new(null, new Uri("https://localhost:7443/docs"), false, false, new("Documentation", 3)), 162new("http", new Uri("http://localhost:5080"), false, false, UrlDisplayPropertiesViewModel.Empty), 163new("tcp", new Uri(TcpUrl), true, false, new("Cache connection", 0))
Integration\Playwright\ResourcePaneResponsiveTests.cs (7)
447var origin = new Uri(page.Url).GetLeftPart(UriPartial.Authority); 1406var expected = new Uri(new Uri(page.Url), href); 2467new("https", new Uri(first), false, false, UrlDisplayPropertiesViewModel.Empty), 2468new("http", new Uri(second), false, false, UrlDisplayPropertiesViewModel.Empty) 2723[new("https", new Uri(Endpoint), false, false, new("Friendly API", 0))], ["Backend", "Public"]), 2725[new("https", new Uri("https://example.test/frontend"), false, false, new(LongFriendlyName, 0))], ["Public"]), 2728[new("tcp", new Uri(TcpEndpoint), false, false, UrlDisplayPropertiesViewModel.Empty)], ["Infrastructure"]),
Integration\Playwright\ResourcesTests.cs (1)
626new UrlViewModel("http", new Uri("about:blank#resource-url"), isInternal: false, isInactive: false, UrlDisplayPropertiesViewModel.Empty)
Integration\Playwright\TemplateResourceAssertionsTests.cs (1)
84urls: [new UrlViewModel("http", new Uri("http://localhost:12345"), false, false, UrlDisplayPropertiesViewModel.Empty)],
Integration\Playwright\TerminalTests.cs (4)
70Assert.Equal($"/resources/{ResourceName}", new Uri(page.Url).AbsolutePath); 89await page.WaitForURLAsync(url => new Uri(url).AbsolutePath.StartsWith("/consolelogs", StringComparison.Ordinal)); 506Origin = new Uri(page.Url).GetLeftPart(UriPartial.Authority) 518var directoryUri = new Uri("file://" + directory).AbsoluteUri;
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
67await dashboardPageWrapper.GotoAsync(new Uri(new Uri(originalUrl), $"/resources/{Uri.EscapeDataString(resourceName)}").AbsoluteUri);
Aspire.Dashboard.Tests (87)
Integration\BlazorWebSocketOriginTests.cs (2)
22var frontendUri = new Uri(app.FrontendSingleEndPointAccessor().GetResolvedAddress()); 37var frontendUri = new Uri(app.FrontendSingleEndPointAccessor().GetResolvedAddress());
Integration\FrontendBrowserTokenAuthTests.cs (16)
40using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 62using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 107var httpsBaseAddress = new Uri(httpsEndpoint.GetResolvedAddress()); 108var httpBaseAddress = new Uri(httpEndpoint.GetResolvedAddress()); 154var httpsResponse = await client.GetAsync(new Uri(new Uri(httpsEndpoint.GetResolvedAddress()), DashboardUrls.LoginUrl(returnUrl: DashboardUrls.TracesUrl(), token: apiKey))).DefaultTimeout(); 155var httpResponse = await client.GetAsync(new Uri(new Uri(httpEndpoint.GetResolvedAddress()), DashboardUrls.LoginUrl(returnUrl: DashboardUrls.TracesUrl(), token: apiKey))).DefaultTimeout(); 194var httpsBaseAddress = new Uri(httpsEndpoint.GetResolvedAddress()); 195var httpBaseAddress = new Uri(httpEndpoint.GetResolvedAddress()); 237BaseAddress = new Uri(httpEndpoint.GetResolvedAddress()) 271BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") 298using var client = new HttpClient { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") }; 322using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 347using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 386var uri = new Uri((string)LogTestHelpers.GetValue(w, "DashboardUri")!); 393var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!); 400var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!);
Integration\FrontendOpenIdConnectAuthTests.cs (2)
36using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 81using var client = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.OtlpServiceHttpEndPointAccessor().EndPoint}") };
Integration\HealthTests.cs (2)
31using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri(basePath) }; 53using var client = new HttpClient { BaseAddress = new Uri($"http://{fixture.App.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\IntegrationTestHelpers.cs (1)
143return new HttpClient(handler) { BaseAddress = new Uri(address) };
Integration\OtlpHttpServiceTests.cs (6)
315using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 346using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 393using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 418using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 447using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") }; 476using var client = new HttpClient { BaseAddress = new Uri($"http://{endpoint.EndPoint}") };
Integration\ResponseCompressionTests.cs (2)
22using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 45using var client = new HttpClient(httpClientHandler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\SetLanguageEndpointTests.cs (5)
28using var client = CreateClient(new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}")); 50using var client = CreateClient(new Uri(httpsEndpoint.GetResolvedAddress())); 67using var client = CreateClient(new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}")); 83using var client = CreateClient(new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}")); 98using var client = CreateClient(new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}"));
Integration\StartupTests.cs (11)
75var uri = new Uri(address); 465BaseAddress = new Uri($"https://{app.FrontendSingleEndPointAccessor().EndPoint}") 566BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") 745var uri = new Uri((string)LogTestHelpers.GetValue(w, "DashboardUri")!); 752var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!); 759var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!); 927var uri = new Uri((string)LogTestHelpers.GetValue(w, "DashboardUri")!); 936var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!); 943var uri = new Uri((string)LogTestHelpers.GetValue(w, "OtlpEndpointUri")!); 993using var client = new HttpClient { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 1070using var client = new HttpClient { BaseAddress = new Uri($"http://{endpointString}") };
Integration\TelemetryApiTests.cs (3)
64using var httpClient = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 136using var httpClient = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") }; 307using var httpClient = new HttpClient(handler) { BaseAddress = new Uri($"http://{app.FrontendSingleEndPointAccessor().EndPoint}") };
Integration\TerminalWebSocketAuthenticationTests.cs (3)
38var frontendUri = new Uri(app.FrontendSingleEndPointAccessor().GetResolvedAddress()); 60var location = new Uri(Assert.Single(socket.HttpResponseHeaders["Location"])); 63Assert.Equal(new Uri(authority.Url).GetLeftPart(UriPartial.Authority), location.GetLeftPart(UriPartial.Authority));
Model\DashboardClientTests.cs (2)
69new Uri($"wss://dashboard.example.com/api/apphost-terminal?terminalId=terminal&viewId={session.Id}"), CancellationToken.None).DefaultTimeout(); 187var uri = new Uri($"wss://dashboard.example.com/api/apphost-terminal?terminalId=terminal&viewId={session.Id}");
Model\ExportHelpersTests.cs (1)
21urls: [new UrlViewModel("http", new Uri("http://localhost:5000"), isInternal: false, isInactive: false, UrlDisplayPropertiesViewModel.Empty)],
Model\ResourceUrlHelpersTests.cs (25)
28var endpoints = GetUrls(ModelTestHelpers.CreateResource(urls: [new("Test", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty)])); 45new("Test", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 46new("Test2", new("http://localhost:8081"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty)]) 72new("Test", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 73new("Test2", new("tcp://localhost:8081"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty)]) 99new("Email", new("mailto:test@example.com"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 100new("FTP", new("ftp://files.example.com/path"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 101new("Custom", new("myapp://resource/123"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty)]) 135new("First", new("https://localhost:8080/test"), isInternal:false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 136new("Test", new("https://localhost:8081/test2"), isInternal:false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty) 162new("First", new("https://localhost:8080/test"), isInternal:true, isInactive : false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 163new("Test", new("https://localhost:8081/test2"), isInternal:false, isInactive : false, displayProperties: UrlDisplayPropertiesViewModel.Empty) 181new("First", new("https://localhost:8080/test"), isInternal: false, isInactive : true, displayProperties: UrlDisplayPropertiesViewModel.Empty), 182new("Test", new("https://localhost:8081/test2"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty) 200new("First", new("https://localhost:8080/test"), isInternal:true, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 201new("Test", new("https://localhost:8081/test2"), isInternal:false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty) 228new("a", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 229new("C", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 230new("D", new("tcp://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 231new("B", new("tcp://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty), 232new("Z", new("https://localhost:8080"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty) 247new("Zero-Https", new("https://localhost:8079"), isInternal: false, isInactive: false, displayProperties: new UrlDisplayPropertiesViewModel(string.Empty, 0)), 248new("Zero-Http", new("http://localhost:8080"), isInternal: false, isInactive: false, displayProperties: new UrlDisplayPropertiesViewModel(string.Empty, 0)), 249new("Positive", new("http://localhost:8082"), isInternal: false, isInactive: false, displayProperties: new UrlDisplayPropertiesViewModel(string.Empty, 1)), 250new("Negative", new("http://localhost:8083"), isInternal: false, isInactive: false, displayProperties: new UrlDisplayPropertiesViewModel(string.Empty, -1))
Model\TelemetryExportServiceTests.cs (1)
1394urls: [new UrlViewModel("http", new Uri("http://localhost:5000"), isInternal: false, isInactive: false, UrlDisplayPropertiesViewModel.Empty)],
ResourceOutgoingPeerResolverTests.cs (1)
30urls: serviceAddress is null || servicePort is null ? [] : [new UrlViewModel(name, new($"http://{serviceAddress}:{servicePort}"), isInternal: false, isInactive: false, displayProperties: UrlDisplayPropertiesViewModel.Empty)]);
Shared\TerminalTestHost.cs (1)
100var frontend = new Uri(_app.FrontendSingleEndPointAccessor().GetResolvedAddress());
Terminal\TerminalWebSocketProxyEndpointTests.cs (3)
130client.ConnectAsync(new Uri($"{DashboardScheme}://{DashboardHost}{path}"), CancellationToken.None)); 153client.ConnectAsync(new Uri($"{endpoint}&viewId={viewId}"), CancellationToken.None)); 163return new Uri($"{DashboardScheme}://{DashboardHost}{path}");
Aspire.Deployment.EndToEnd.Tests (5)
AcaExpressDeploymentTests.cs (1)
282urls.Add(name, new Uri($"https://{hostname}"));
FoundryDotnetProjectDeploymentTests.cs (1)
180return new Uri(projectDocument.RootElement.GetProperty("properties").GetProperty("endpoints").GetProperty("AI Foundry API").GetString()
FoundryHostedAgentDeploymentTests.cs (2)
227var resourcesUri = new Uri( 274new Uri(projectEndpoint
Helpers\EntraDeploymentHelpers.cs (1)
374var scope = new Uri(url).Host switch
Aspire.EndToEnd.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
67await dashboardPageWrapper.GotoAsync(new Uri(new Uri(originalUrl), $"/resources/{Uri.EscapeDataString(resourceName)}").AbsoluteUri);
Aspire.Hosting (3)
Devcontainers\Codespaces\CodespacesUrlRewriter.cs (1)
35return RewriteUrl(new Uri(url));
DistributedApplicationBuilder.cs (1)
782options.Endpoint = new Uri(url);
ProjectResourceBuilderExtensions.cs (1)
856var baseUri = new Uri(url.Url);
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\BicepProvisioner.cs (1)
1366var client = secretClientProvider.GetSecretClient(new(vaultUri));
Aspire.Hosting.Azure.Tests (20)
AzureBicepProvisionerTests.cs (1)
1591var vaultUri = new Uri("https://test.vault.azure.net/");
AzureContainerAppExpressTests.cs (1)
324KeyVaultUri = new Uri("https://example.vault.azure.net/secrets/example"),
AzureWebPubSubEmulatorTests.cs (1)
162var matches = request.Method == HttpMethod.Get && request.RequestUri == new Uri("http://localhost:18080/api/health");
DefaultArmClientProviderTests.cs (1)
35new Uri("https://management.contoso.example"),
FoundryConnectionPropertiesTests.cs (1)
40aiFoundry.Resource.EmulatorServiceUri = new Uri("http://localhost:8080");
FoundryDeploymentConnectionPropertiesTests.cs (1)
21deployment.Resource.Parent.EmulatorServiceUri = new Uri("http://localhost:8080");
FoundryExtensionsTests.cs (14)
169Assert.Equal(new Uri(expectedEndpoint), endpoint); 410Assert.Equal(new Uri("http://windows-host:5273/models/loaded"), request.RequestUri); 419new Uri("http://windows-host:5273/"), 4361 => new Uri("http://windows-host:5273/models/loaded"), 4372 => new Uri("http://windows-host:5273/openai/loadedmodels"), 452new Uri("http://windows-host:5273/"), 475new Uri("http://windows-host:5273/"), 498new Uri("http://windows-host:5273/"), 512Assert.Equal(new Uri("http://windows-host:5273/v1/models"), request.RequestUri); 517EmulatorServiceUri = new Uri("http://windows-host:5273/") 5341 => new Uri("http://windows-host:5273/v1/models"), 5352 => new Uri("http://windows-host:5273/openai/status"), 544EmulatorServiceUri = new Uri("http://windows-host:5273/") 563Assert.Equal(new Uri("http://windows-host:5273/"), foundry.Resource.EmulatorServiceUri);
Aspire.Hosting.Browsers.Tests (22)
BrowserHostTests.cs (1)
30new Uri("ws://127.0.0.1:9/devtools/browser/stale"),
BrowserLogsBuilderExtensionsTests.cs (3)
766new Uri("https://localhost:8443/"), 1781new Uri("https://localhost:5001/"), 1865public Uri BrowserDebugEndpoint { get; } = new($"ws://127.0.0.1:{9000 + sessionNumber}/devtools/browser/browser-{sessionNumber}");
BrowserLogsCdpConnectionTests.cs (3)
24new Uri("ws://127.0.0.1:12345/devtools/browser/test"), 43new Uri("ws://127.0.0.1/devtools/browser/test"), 118new Uri("ws://127.0.0.1/devtools/browser/test"),
BrowserLogsRunningSessionTests.cs (3)
46new Uri("https://localhost:5001/"), 76Assert.Equal(new Uri("https://localhost:5001/"), host.PageSession?.Url); 110public Uri DebugEndpoint { get; } = new("ws://127.0.0.1/devtools/browser/test");
BrowserLogsSessionManagerTests.cs (5)
266new Uri("ws://127.0.0.1:9/devtools/browser/stale"), 295new Uri("ws://127.0.0.1:9/devtools/browser/stale"), 555new Uri("https://localhost"), 579var browserEndpoint = new Uri($"ws://127.0.0.1:{((IPEndPoint)listener.LocalEndpoint).Port}/devtools/browser/test"); 650public Uri DebugEndpoint { get; } = new("ws://127.0.0.1/devtools/browser/test");
BrowserPageSessionTests.cs (7)
55new Uri("https://localhost:5001/"), 113new Uri("https://localhost:5001/"), 153new Uri("https://localhost:5001/"), 183new Uri("https://localhost:5001/"), 221new Uri("https://localhost:5001/"), 299new Uri("https://localhost:5001/"), 355public Uri DebugEndpoint { get; } = new("ws://127.0.0.1/devtools/browser/test");
Aspire.Hosting.CodeGeneration.Go.Tests (3)
GoScaffoldTests.cs (3)
127var applicationUrls = profile["applicationUrl"]!.GetValue<string>().Split(';').Select(url => new Uri(url)).ToList(); 130var otlpHttps = new Uri(environmentVariables["ASPIRE_DASHBOARD_OTLP_ENDPOINT_URL"]!.GetValue<string>()); 131var resourceServiceHttps = new Uri(environmentVariables["ASPIRE_RESOURCE_SERVICE_ENDPOINT_URL"]!.GetValue<string>());
Aspire.Hosting.CodeGeneration.TypeScript.Tests (1)
TypeScriptLanguageSupportTests.cs (1)
358private static int GetPort(string url) => new Uri(url).Port;
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
788&& string.Equals(currentUri.Host, new Uri(previousInspectUrl).Host, StringComparison.OrdinalIgnoreCase) 791replacementHost = new Uri(inspectUrl).Host;
Aspire.Hosting.DevTunnels.Tests (17)
DevTunnelMonitorTests.cs (5)
167Ports = [new(3000, "http") { PortUri = new("https://replacement-3000.usw2.devtunnels.ms/") }] 294Ports = [new(3000, "http") { PortUri = new("https://replacement-3000.usw2.devtunnels.ms") }] 342Ports = [new(3000, "http") { PortUri = new("https://replacement-3000.usw2.devtunnels.ms") }] 627new(3001, "http") { PortUri = new("https://original-3001.usw2.devtunnels.ms/") } 795Ports = [new(3000, "http") { PortUri = new("https://service-assigned-name.usw2.devtunnels.ms") }]
DevTunnelOutputParserTests.cs (5)
38Assert.Equal(new(DevTunnelOutputParser.OutputKind.Port, 3000, new("https://abc-3000.usw2.devtunnels.ms/")), parser.Parse(url)); 45Assert.Equal(new(DevTunnelOutputParser.OutputKind.Port, 3000, new("https://abc-3000.usw2.devtunnels.ms/")), 57Assert.Equal(new(DevTunnelOutputParser.OutputKind.Port, 3000, new("https://abc-3000.usw2.devtunnels.ms/")), 110Assert.Equal(new(DevTunnelOutputParser.OutputKind.Port, 3000, new("https://abc-3000.usw2.devtunnels.ms/")), 121Assert.Equal(new(DevTunnelOutputParser.OutputKind.Port, 3000, new("https://abc-3000.usw2.devtunnels.ms/")),
DevTunnelResourceBuilderExtensionsTests.cs (6)
298PortUri = new("https://mytunnel-5001.eun1.devtunnels.ms") 360PortUri = new("https://mytunnel-5001.devtunnels.ms") 566PortUri = new Uri("https://n4skq32k-3000.use.devtunnels.ms/") 656PortUri = new Uri("https://n4skq32k-3000.use.devtunnels.ms/") 706PortUri = new Uri("https://n4skq32k-3000.use.devtunnels.ms/") 752PortUri = new Uri($"{tunnelUrl}/")
TestDevTunnelMonitor.cs (1)
48Ports = [new(3000, "http") { PortUri = new("https://original-3000.usw2.devtunnels.ms/") }]
Aspire.Hosting.Dotnet.Tests (1)
DotnetProjectBuildCoordinatorTests.cs (1)
1291var feedSource = new Uri(feed + Path.DirectorySeparatorChar).AbsoluteUri;
Aspire.Hosting.Foundry (4)
HostedAgent\AzureHostedAgentResource.cs (1)
168var projectClient = new AIProjectClient(new Uri(projectEndpoint), credential);
PromptAgent\AzurePromptAgentResource.cs (1)
212var projectClient = new AIProjectClient(new Uri(projectEndpoint), credential);
PromptAgent\PromptAgentBuilderExtensions.cs (1)
94var projectClient = new AIProjectClient(new Uri(endpoint), new DefaultAzureCredential());
Toolbox\FoundryToolboxResource.cs (1)
274endpoint = new Uri(endpoint.GetLeftPart(UriPartial.Path).TrimEnd('/'));
Aspire.Hosting.Foundry.Tests (5)
AzureFoundryToolboxAdministrationTests.cs (1)
68new Uri("https://example.invalid/api/projects/my-project"), new TestTokenCredential(), options);
HostedAgentExtensionTests.cs (1)
768new Uri("https://example.invalid/api/projects/my-project"),
PromptAgentTests.cs (1)
153new Uri("https://example.invalid/api/projects/my-project"),
ToolboxTests.cs (2)
419new Uri("https://project.example.com/toolboxes/field-tools/mcp?api-version=v1"), 464new Uri("https://project.example.com/toolboxes/field-tools/mcp?api-version=v1"),
Aspire.Hosting.Kubernetes.Tests (1)
KubernetesPublisherTests.cs (1)
2197context.EnvironmentVariables["URI_VALUE"] = new Uri("https://example.com/path");
Aspire.Hosting.MongoDB.Tests (4)
MongoDbFunctionalTests.cs (1)
138using var httpClient = new HttpClient { BaseAddress = new Uri(endpoint.Url) };
ReplicaSet\MongoDbReplicaSetFunctionalTests.cs (2)
145using var httpClient = new HttpClient { BaseAddress = new Uri(endpoint.Url) }; 232using var httpClient = new HttpClient { BaseAddress = new Uri(mongoExpressEndpoint.Url) };
SingleMemberReplicaSetFunctionalTests.cs (1)
101using var httpClient = new HttpClient { BaseAddress = new Uri(mongoExpress.Resource.GetEndpoint("http").Url) };
Aspire.Hosting.Native.Core.Tests (3)
NativeDashboardConfigurationTests.cs (2)
25var spec = DcpDashboardConfiguration.Create(path, "frontend", new("http://127.0.0.1:12345"), 41new("http://127.0.0.1:12345"), new("resource-key", "browser-token", "dashboard-key", "otlp-key")));
TestServices\DcpCleanupTestHandler.cs (1)
26return new DcpApiClient(options, new HttpClient(this) { BaseAddress = new Uri("http://localhost") });
Aspire.Hosting.Native.Server (2)
Auxiliary\NativeAuxiliaryBackchannel.cs (1)
97? new Uri(url).GetLeftPart(UriPartial.Authority) : null;
Dashboard\NativeDashboardHost.cs (1)
87return new NativeDashboardHost(application, new Uri(addresses.Addresses.Single()), options, requests);
Aspire.Hosting.Nats.Tests (1)
NatsFunctionalTests.cs (1)
133? connectionString!.Replace(new Uri(connectionString).UserInfo, null)
Aspire.Hosting.OpenAI (3)
OpenAIHealthCheck.cs (2)
14private static readonly Uri s_defaultEndpointUri = new("https://api.openai.com/v1"); 15private static readonly Uri s_statusPageUri = new("https://status.openai.com/api/v2/status.json");
OpenAIModelHealthCheck.cs (1)
40using var request = new HttpRequestMessage(HttpMethod.Get, new Uri($"{endpoint}/models/{model}"));
Aspire.Hosting.RabbitMQ (1)
RabbitMQBuilderExtensions.cs (1)
70Uri = new Uri(connectionString)
Aspire.Hosting.Redis.Tests (2)
RedisFunctionalTests.cs (2)
124var commanderEndpointUri = new Uri(commanderEvent.Snapshot.Urls.First(u => u.Name == "http").Url); 135Assert.Equal(commanderEndpointUri, new Uri(managementUrl.Url));
Aspire.Hosting.Seq.Tests (1)
SeqFunctionalTests.cs (1)
46BaseAddress = new Uri(url)
Aspire.Hosting.Testing (2)
DistributedApplicationHostingTestingExtensions.cs (2)
156client.BaseAddress = new(baseUri); 233return new(GetEndpointUriStringCore(app, resourceName, endpointName, networkIdentifier));
Aspire.Hosting.Testing.Tests (7)
DashboardUrlTests.cs (4)
56new Uri(dashboardUri.GetLeftPart(UriPartial.Authority) + "/structuredlogs"), 208new($"{firstBaseUrl}/login?t=wrong-token"), 209new(firstBaseUrl + secondUrl.PathAndQuery), 210new($"{firstBaseUrl}/login?t=%25")
TestingBuilderTests.cs (2)
628var uri = new Uri(resourceServiceUri); 656var uri = new Uri(resourceServiceUri);
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
67await dashboardPageWrapper.GotoAsync(new Uri(new Uri(originalUrl), $"/resources/{Uri.EscapeDataString(resourceName)}").AbsoluteUri);
Aspire.Hosting.Tests (30)
ApplicationModel\EndpointHostHelpersTests.cs (4)
49var result = EndpointHostHelpers.IsLocalhost(new Uri($"http://{host}:12345")); 98var result = EndpointHostHelpers.IsLocalhostTld(new Uri($"http://{host}:12345")); 148var result = EndpointHostHelpers.IsDevLocalhostTld(new Uri($"http://{host}:12345")); 203var result = EndpointHostHelpers.IsLocalhostOrLocalhostTld(new Uri($"http://{host}:12345"));
ApplicationModel\McpServerEndpointAnnotationTests.cs (1)
20var expectedUri = new Uri("http://custom.example.com:9000/mcp");
Dashboard\DashboardEventHandlersTests.cs (1)
567var uri = new Uri(dashboardUrlValue);
Dashboard\DashboardServiceHostTests.cs (5)
20var uri = uriString is not null ? new Uri(uriString) : null; 45var uri = new Uri(uriString); 61var uri = new Uri(uriString); 78var uri = new Uri(uriString); 88var uri = new Uri("http://192.168.1.1:5000");
Dcp\KubernetesServiceTests.cs (1)
2678var port = new Uri(address).Port;
DistributedApplicationTests.cs (1)
1567var actualUri = new Uri(resourceServiceUri);
ExternalServiceTests.cs (6)
33var uri = new Uri("https://nuget.org/"); 84var uriWithPath = new Uri("https://api.example.com/api/v1"); 575var uri = new Uri("https://api.example.com/service"); 586var uri = new Uri("https://api.example.com/service/#fragment"); 600var uri = new Uri("https://api.example.com/service/?query=1"); 614var uri = new Uri("https://api.example.com/service/");
Health\FriendlyHealthCheckErrorMessagesTests.cs (6)
140var endpoint = new Uri(webApp.Urls.First() + "/"); 165var uri = new Uri("http://user:secret@example.com:8080/"); 178var uri = new Uri("http://example.com:8080/"); 189var uri = new Uri("http://example.com/"); 200var uri = new Uri("http://example.com/"); 213var uri = new Uri("http://example.com/");
Orchestrator\ApplicationOrchestratorTests.cs (1)
336Assert.Equal(expectedOrigin, new Uri(primaryUrl.Url).GetLeftPart(UriPartial.Authority));
ResourceNotificationTests.cs (1)
69nameof(ExternalServiceResource) => new ExternalServiceResource("test", new Uri("http://localhost/")),
Utils\PasswordGeneratorTests.cs (1)
111Exception? exception = Record.Exception(() => new Uri($"https://guest:{password}@localhost:12345"));
WithReferenceTests.cs (2)
805.WithReference("petstore", new Uri("https://petstore.swagger.io/v2")); 822.WithReference("petstore", new Uri("https://petstore.swagger.io/"));
Aspire.Hosting.Yarp.Tests (4)
YarpClusterTests.cs (3)
140var uri = new Uri("https://example.com:8080"); 156var destinations = new object[] { "http://localhost:5000", new Uri("http://localhost:5001") }; 222var uri = new Uri("https://example.com");
YarpConfigGeneratorTests.cs (1)
181Address = new Uri("http://localhost:8080"),
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration.Tests (3)
AspireAppConfigurationExtensionsTest.cs (3)
18var endpoint = new Uri(ConformanceTests.Endpoint); 73settings.Endpoint = new Uri("https://unused.azconfig.io/"); 86var endpoint = new Uri("https://aspiretests.azconfig.io/");
Aspire.Milvus.Client.Tests (2)
AspireMilvusExtensionTests.cs (2)
65builder.AddKeyedMilvusClient(DefaultKeyName, settings => { settings.Endpoint = new Uri("http://localhost:19530"); settings.Key = DefaultApiKey; }); 69builder.AddMilvusClient(DefaultKeyName, settings => { settings.Endpoint = new Uri("http://localhost:19530"); settings.Key = DefaultApiKey; });
Aspire.OpenAI.Tests (1)
AspireOpenAIExtensionsTests.cs (1)
50var uri = new Uri("https://api.openai.com/");
Aspire.Playground.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
67await dashboardPageWrapper.GotoAsync(new Uri(new Uri(originalUrl), $"/resources/{Uri.EscapeDataString(resourceName)}").AbsoluteUri);
Aspire.RabbitMQ.Client (1)
AspireRabbitMQExtensions.cs (1)
105factory.Uri = new(connectionString);
Aspire.RabbitMQ.Client.Tests (1)
AspireRabbitMQExtensionsTests.cs (1)
266var uri = new Uri(expectedUri);
Aspire.Seq (4)
AspireSeqExtensions.cs (2)
57settings.Logs.Endpoint = new Uri($"{settings.ServerUrl}/ingest/otlp/v1/logs"); 58settings.Traces.Endpoint = new Uri($"{settings.ServerUrl}/ingest/otlp/v1/traces");
SeqHealthCheck.cs (2)
14private readonly HttpClient _client = new(new SocketsHttpHandler { ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) }; 15private readonly string _displayHealthUri = new Uri(new Uri(seqUri), "/health").GetComponents(UriComponents.HttpRequestUrl, UriFormat.Unescaped);
Aspire.Seq.Tests (5)
SeqEndpointCanBeConfigured.cs (5)
46s.Logs.Endpoint = new Uri("http://localhost:1234/ingest/otlp/v1/logs"); 47s.Traces.Endpoint = new Uri("http://localhost:1234/ingest/otlp/v1/traces"); 50Assert.Equal(settings.Logs.Endpoint, new Uri("http://localhost:9876/ingest/otlp/v1/logs")); 51Assert.Equal(settings.Traces.Endpoint, new Uri("http://localhost:9876/ingest/otlp/v1/traces")); 80var endpoint = new Uri($"http://127.0.0.1:{port}");
Aspire.Templates.Tests (1)
tests\Shared\Playwright\DashboardResourceAssertions.cs (1)
67await dashboardPageWrapper.GotoAsync(new Uri(new Uri(originalUrl), $"/resources/{Uri.EscapeDataString(resourceName)}").AbsoluteUri);
Aspire.TestTools (1)
GitHubApiClient.cs (1)
87return new GitHubApiClient(http, GetDefaultTokenAsync, new Uri("https://api.github.com/")) { _ownsHttpClient = true };
Aspire.Tray.Tests (1)
src\Aspire.Tray\Linux\LinuxFileManager.cs (1)
53var uri = new Uri(Path.GetFullPath(path)).AbsoluteUri;
Binding.Custom.IntegrationTests (1)
CustomBindingTests.4.1.0.cs (1)
35factory = new ChannelFactory<IWcfService>(binding, new EndpointAddress(new Uri(Endpoints.Tcp_CustomBinding_SslStreamSecurity_Address), endpointIdentity));
Binding.UDS.IntegrationTests (4)
ServiceHelper.cs (1)
26options.Listen(new Uri("net.uds://" + linuxSocketFilepath));
UDSBindingTests.cs (3)
78var uri = new Uri("net.uds://" + UDS.GetUDSFilePath()); 115new System.ServiceModel.EndpointAddress(new Uri(uriBuilder.ToString()), identity)); 159new System.ServiceModel.EndpointAddress(new Uri("net.uds://" + UDS.GetUDSFilePath())));
Binding.WS.FederationHttp.IntegrationTests (6)
WSFederationHttpBindingTests.cs (6)
37issuerAddress = new EndpointAddress(new Uri(Endpoints.WSFederationAuthorityLocalSTS + endpointSuffix)); 39serviceEndpointAddress = new EndpointAddress(new Uri(tokenTargetAddress)); 97issuerAddress = new EndpointAddress(new Uri(Endpoints.WSFederationAuthorityLocalSTS + "wsHttp/wstrustFeb2005")); 99serviceEndpointAddress = new EndpointAddress(new Uri(tokenTargetAddress)); 148issuerAddress = new EndpointAddress(new Uri(Endpoints.WSFederationAuthorityLocalSTS + "wsHttp/wstrust13")); 150serviceEndpointAddress = new EndpointAddress(new Uri(tokenTargetAddress));
Binding.WS.TransportWithMessageCredentialSecurity.IntegrationTests (15)
BasicHttpsTransportWithMessageCredentialSecurityTests.cs (1)
27endpointAddress = new EndpointAddress(new Uri(Endpoints.BasicHttpsBinding_SecModeTransWithMessCred_ClientCredTypeCert));
BasicHttpTransportWithMessageCredentialSecurityTests.cs (4)
28endpointAddress = new EndpointAddress(new Uri(Endpoints.BasicHttps_SecModeTransWithMessCred_ClientCredTypeCert)); 78endpointAddress = new EndpointAddress(new Uri(Endpoints.BasicHttps_SecModeTransWithMessCred_ClientCredTypeUserName + $"/{Enum.GetName(typeof(TransferMode), transferMode)}")); 126endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_SecModeTransWithMessCred_ClientCredTypeUserName)); 178endpointAddress = new EndpointAddress(new Uri(Endpoints.BasicHttps_SecModeTransWithMessCred_ClientCredTypeUserName + $"/{Enum.GetName(typeof(TransferMode), transferMode)}"));
WS2007HttpTransportWithMessageCredentialsSecurityTests.cs (2)
32endpointAddress = new EndpointAddress(new Uri(Endpoints.Https2007_SecModeTransWithMessCred_ClientCredTypeCert)); 80endpointAddress = new EndpointAddress(new Uri(Endpoints.Https2007_SecModeTransWithMessCred_ClientCredTypeUserName));
WSHttpTransportWithMessageCredentialSecurityTests.cs (4)
33endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_SecModeTransWithMessCred_ClientCredTypeCert)); 81endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_SecModeTransWithMessCred_ClientCredTypeUserName)); 130new EndpointAddress(new Uri(Endpoints.Https_SecModeTransWithMessCred_ClientCredTypeWindows))); 172new EndpointAddress(new Uri(Endpoints.Https_SecModeTransWithMessCred_ClientCredTypeWindows_NoSecureConversation)));
WSNetTcpTransportWithMessageCredentialSecurityTests.cs (4)
35endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_SecModeTransWithMessCred_ClientCredTypeCert)); 92endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_SecModeTransWithMessCred_ClientCredTypeUserName)); 166new EndpointAddress(new Uri(Endpoints.Tcp_SecModeTransWithMessCred_ClientCredTypeWindows))); 217new EndpointAddress(new Uri(Endpoints.Tcp_SecModeTransWithMessCred_ClientCredTypeWindows_NoSecureConversation)));
BlazorHosted (1)
Program.cs (1)
44client.BaseAddress = new Uri("https+http://weatherapi");
BlazorHosted.Client (2)
Program.cs (2)
19client.BaseAddress = new Uri("https+http://weatherapi"); 25client.BaseAddress = new Uri("https+http://timeapi");
BlazorHosted.ClientServiceDefaults (1)
Extensions.cs (1)
43var baseAddress = new Uri(builder.HostEnvironment.BaseAddress);
BlazorStandalone (3)
Program.cs (3)
21builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 27client.BaseAddress = new Uri("https+http://weatherapi"); 33client.BaseAddress = new Uri("https+http://timeapi");
BlazorStandalone.ClientServiceDefaults (1)
Extensions.cs (1)
43var baseAddress = new Uri(builder.HostEnvironment.BaseAddress);
CdkSample.ApiService (1)
Program.cs (1)
31clients.AddConfigurationClient(new Uri(builder.Configuration.GetConnectionString("appConfig")!));
Client.ChannelLayer.IntegrationTests (3)
DuplexChannelWithSynchronizationContext.cs (3)
35EndpointAddress endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_Certificate_Duplex_Address)); 96EndpointAddress endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_Certificate_Duplex_Address)); 175EndpointAddress endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_Certificate_Duplex_Address));
Client.ClientBase.IntegrationTests (2)
ClientBaseTests.4.1.0.cs (2)
35cookieManager.CookieContainer.Add(new Uri(Endpoints.HttpBaseAddress_Basic_Text), new System.Net.Cookie(cookieName, cookieValue)); 68Uri uri = new Uri(Endpoints.HttpBaseAddress_Basic_Text);
Client.ExpectedExceptions.IntegrationTests (5)
ExpectedExceptionTests.4.1.0.cs (3)
92string hostName = new Uri(Endpoints.HttpBaseAddress_Basic_Text).Host; 388endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_RevokedServerCertResource_Address), new DnsEndpointIdentity(Endpoints.Tcp_RevokedServerCertResource_HostName)); 435endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_InvalidEkuServerCertResource_Address), new DnsEndpointIdentity(Endpoints.Tcp_InvalidEkuServerCertResource_HostName));
ExpectedExceptionTests.4.1.1.cs (1)
33endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_VerifyDNS_Address), new DnsEndpointIdentity(Endpoints.Tcp_VerifyDNS_HostName));
NamedPipeConnectionTests.cs (1)
32Uri address = new Uri($"net.pipe://localhost/NamedPipeConnectionTests/{Guid.NewGuid():N}/");
DevTunnels.ApiService (1)
Program.cs (1)
8builder.Services.AddHttpClient("frontend", client => client.BaseAddress = new("https://frontend"));
dotnet-aot (2)
parent\dotnet\Commands\Sdk\Check\SdkCheckCommand.cs (1)
54_sdkCheckConfig?.ReleasesUri == null ? null : new Uri(_sdkCheckConfig.ReleasesUri),
parent\dotnet\Commands\Test\MTP\IPC\HttpTestHostGateway.cs (1)
56var endpoint = new Uri($"http://127.0.0.1:{port}/{path}");
dotnet-openapi (1)
Commands\BaseCommand.cs (1)
382var uri = new Uri(url);
dotnet-svcutil-lib (25)
CommandProcessorOptions.cs (1)
746this.Inputs.Insert(idx, new Uri(file));
FrameworkFork\Microsoft.Xml\Xml\XmlResolver.cs (1)
49uri = new Uri(Path.GetFullPath(relativeUri));
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (1)
1000s_dataContractXsdBaseNamespaceUri = new Uri(DataContractXsdBaseNamespace);
FrameworkFork\System.ServiceModel\System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
206claims.Add(Claim.CreateUriClaim(new Uri(value)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Addressing.cs (2)
447return new Uri(toString); 746internal static readonly Uri ReplyRelationshipType = new Uri(Addressing10Strings.ReplyRelationship);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\AddressingVersion.cs (2)
52_anonymousUri = new Uri(anonymous); 57_noneUri = new Uri(none);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\BinaryMessageEncoder.cs (1)
1430_toHeader = ToHeader.Create(new Uri(toString.Value), _messageVersion.Addressing);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingChannels.cs (1)
29: this(factory, settings, s_anonymousEndpointAddress, settings.MessageVersion.Addressing == AddressingVersion.None ? null : new Uri("http://www.w3.org/2005/08/addressing/anonymous"),
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\FramingDecoders.cs (1)
225_via = new Uri(value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1117_httpRequestMessage.Headers.Referrer = new Uri(value);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\Message.cs (1)
2045uri = new Uri(uriString);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\PrivacyNoticeBindingElementImporter.cs (1)
38settings.Url = new Uri(privacyNoticeAssertion.InnerText);
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\MetadataExchangeClient.cs (1)
587return new Uri(new Uri(baseUri), relativeUri);
FrameworkFork\System.ServiceModel\System\ServiceModel\EndpointAddress.cs (3)
98Uri u = new Uri(uri); 234s_anonymousUri = new Uri(AddressingStrings.AnonymousUri); 244s_noneUri = new Uri(AddressingStrings.NoneUri);
FrameworkFork\System.ServiceModel\System\ServiceModel\Security\WSSecurityPolicy.cs (1)
2831private static readonly Uri s_selfIssuerUri = new Uri(WSIdentityNamespace + "/issuer/self");
Metadata\MetadaExchangeResolver.cs (6)
109metadataResolved = await ResolveMetadataAsync(new Uri(baseUri + mexUri), MetadataExchangeClientMode.MetadataExchange, false, cancellationToken).ConfigureAwait(false); 118metadataResolved = await ResolveMetadataAsync(new Uri(baseUri + wsdlQuery), MetadataExchangeClientMode.HttpGet, false, cancellationToken).ConfigureAwait(false); 134metadataResolved = await ResolveMetadataAsync(new Uri(baseUri + wsdlQuery), MetadataExchangeClientMode.HttpGet, false, cancellationToken).ConfigureAwait(false); 138metadataResolved = await ResolveMetadataAsync(new Uri(baseUri), MetadataExchangeClientMode.HttpGet, true, cancellationToken).ConfigureAwait(false); 146metadataResolved = await ResolveMetadataAsync(new Uri(baseUri), MetadataExchangeClientMode.MetadataExchange, false, cancellationToken).ConfigureAwait(false); 149metadataResolved = await ResolveMetadataAsync(new Uri(baseUri + mexUri), MetadataExchangeClientMode.MetadataExchange, false, cancellationToken).ConfigureAwait(false);
dotnet-svcutil-lib.Tests (1)
GlobalToolTests.cs (1)
248options.Inputs.Add(new Uri(url));
DotnetProject.WorkerService (1)
Program.cs (1)
9builder.Services.AddHttpClient("apiservice", client => client.BaseAddress = new("http://apiservice"));
EntraId.Web (1)
Program.cs (1)
32builder.Services.AddHttpClient(GraphController.HttpClientName, client => client.BaseAddress = new Uri("https://graph.microsoft.com/v1.0/"));
Infrastructure.Tests (4)
PowerShellScripts\DownloadNativeArchivesTests.cs (1)
34var port = new Uri(server.CollectionUri).Port;
TestTriggerMap\PrComparisonBaseTests.cs (3)
33GitCli.Run(workspace.Path, "clone", "--no-local", new Uri(repo).AbsoluteUri, checkout); 134GitCli.Run(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout); 172GitCli.Run(workspace.Path, "clone", "--depth=1", "--no-local", new Uri(repo).AbsoluteUri, checkout);
Keycloak.Web (1)
Program.cs (1)
26client.BaseAddress = new("https+http://apiservice");
Microsoft.AspNetCore.Authentication.Google (1)
GoogleHandler.cs (1)
72var queryStrings = QueryHelpers.ParseQuery(new Uri(base.BuildChallengeUrl(properties, redirectUri)).Query);
Microsoft.AspNetCore.Components.WebAssembly.Server (6)
TargetPickerUi.cs (5)
371var underlyingV8Endpoint = new Uri(tabToDebug.WebSocketDebuggerUrl); 372var proxyEndpoint = new Uri(_debugProxyUrl); 373var devToolsUrlAbsolute = new Uri(new Uri(_browserHost), relativeUri: NormalizeDevtoolsFrontendUrl(tabToDebug.DevtoolsFrontendUrl)); 403var debuggerPort = new Uri(_browserHost).Port; 429var debuggerPort = new Uri(_browserHost).Port;
WebAssemblyNetDebugProxyAppBuilderExtensions.cs (1)
37browserUrl = new Uri(browserParam);
Microsoft.AspNetCore.Components.WebView (2)
StaticContentProvider.cs (1)
25var fileUri = new Uri(requestUri);
WebViewManager.cs (1)
246=> uri.AbsoluteUri.EndsWith('/') ? uri : new Uri(uri.AbsoluteUri + '/');
Microsoft.AspNetCore.Components.WebView.Maui (2)
Extensions\UriExtensions.cs (1)
16 var uri = new Uri(uriString!);
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
93 var requestPath = new Uri(requestAbsoluteUri).AbsolutePath.Substring(1);
Microsoft.AspNetCore.Components.WebView.WindowsForms (3)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
93 var requestPath = new Uri(requestAbsoluteUri).AbsolutePath.Substring(1);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
59 internal static readonly Uri AppOriginUri = new(AppOrigin); 291 _webview.CoreWebView2.WebMessageReceived += (s, e) => MessageReceived(new Uri(e.Source), e.TryGetWebMessageAsString());
Microsoft.AspNetCore.Components.WebView.Wpf (3)
src\BlazorWebView\src\SharedSource\StaticContentHotReloadManager.cs (1)
93 var requestPath = new Uri(requestAbsoluteUri).AbsolutePath.Substring(1);
src\BlazorWebView\src\SharedSource\WebView2WebViewManager.cs (2)
59 internal static readonly Uri AppOriginUri = new(AppOrigin); 291 _webview.CoreWebView2.WebMessageReceived += (s, e) => MessageReceived(new Uri(e.Source), e.TryGetWebMessageAsString());
Microsoft.AspNetCore.Http.Connections.Client (1)
HttpConnection.cs (1)
349uri = new Uri(negotiationResponse.Url);
Microsoft.AspNetCore.InternalTesting (2)
HttpClientSlim.cs (2)
26=> await GetStringAsync(new Uri(requestUri), validateCertificate).ConfigureAwait(false); 69=> await PostAsync(new Uri(requestUri), content, validateCertificate).ConfigureAwait(false);
Microsoft.AspNetCore.Mvc.Testing (3)
WebApplicationFactory.cs (2)
392_webHostAddress = new Uri(serverAddressFeature.Addresses.Last()); 808client.BaseAddress = new Uri("http://localhost");
WebApplicationFactoryClientOptions.cs (1)
17internal static readonly Uri DefaultBaseAddres = new Uri("http://localhost");
Microsoft.AspNetCore.Server.IntegrationTesting (5)
Common\DeploymentResult.cs (1)
67BaseAddress = new Uri(ApplicationBaseUri),
Common\TestUriHelper.cs (1)
52var uriHint = new Uri(hint);
Deployers\NginxDeployer.cs (2)
35new Uri("http://localhost:0") : 36new Uri(DeploymentParameters.ApplicationBaseUriHint);
Deployers\SelfHostDeployer.cs (1)
158actualUrl = new Uri(m.Groups["url"].Value);
Microsoft.AspNetCore.SignalR.Client (4)
HubConnectionBuilderHttpExtensions.cs (4)
42hubConnectionBuilder.WithUrlCore(new Uri(url), null, null); 55hubConnectionBuilder.WithUrlCore(new Uri(url), null, configureHttpConnection); 68hubConnectionBuilder.WithUrlCore(new Uri(url), transports, null); 82hubConnectionBuilder.WithUrlCore(new Uri(url), transports, configureHttpConnection);
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyMiddleware.cs (1)
46if (context.Request.Path.Equals(new Uri(_options.Value.ServerUrl).LocalPath))
Microsoft.AspNetCore.SpaServices.Extensions (3)
AngularCli\AngularCliMiddleware.cs (1)
88var uri = new Uri(openBrowserLine.Groups[1].Value);
Proxying\SpaProxy.cs (1)
72var targetUri = new Uri((baseUriAsString.EndsWith("/", StringComparison.OrdinalIgnoreCase) ? baseUriAsString[..^1] : baseUriAsString)
Proxying\SpaProxyingExtensions.cs (1)
30new Uri(baseUri));
Microsoft.AspNetCore.TestHost (2)
TestServer.cs (1)
112public Uri BaseAddress { get; set; } = new Uri("http://localhost/");
TestServerOptions.cs (1)
26public Uri BaseAddress { get; set; } = new Uri("http://localhost/");
Microsoft.AspNetCore.Testing (1)
ServiceFakesHostExtensions.cs (1)
79.Select(x => new Uri(x.Replace("[::]", "localhost", StringComparison.OrdinalIgnoreCase)));
Microsoft.Build (3)
ElementLocation\ElementLocation.cs (1)
253: new Uri(sourceUri).LocalPath;
Logging\TerminalLogger\TerminalLogger.cs (2)
645logger.OutputFilePaths.Select(outputPath => $"{AnsiCodes.LinkPrefix}{new Uri(outputPath).AbsoluteUri}{AnsiCodes.LinkInfix}{outputPath}{AnsiCodes.LinkSuffix}")); 1419private static Uri GenerateLinkForHelpKeyword(string helpKeyword) => new($"https://go.microsoft.com/fwlink/?LinkId={helpKeyword}");
Microsoft.Build.Tasks.Core (6)
BootstrapperUtil\Util.cs (1)
53var uri = new Uri(path);
GetSDKReferenceFiles.cs (1)
1098var codeBase = new Uri(currentAssembly);
ManifestUtil\PathUtil.cs (3)
32Uri uri = new Uri(url); 53Uri u = new Uri(resolvedPath); 223var u = new Uri(path);
SignFile.cs (1)
61TimestampUrl == null ? null : new Uri(TimestampUrl),
Microsoft.Build.Tasks.Git (2)
GitOperations.cs (2)
197return new Uri("file:///" + url + "/"); 220var rootUri = new Uri(root.EndWithSeparator('/'));
Microsoft.CodeAnalysis (1)
CommandLine\SarifErrorLogger.cs (1)
123private static readonly Uri s_fileRoot = new Uri("file:///");
Microsoft.Deployment.DotNet.Releases (6)
Cve.cs (1)
81new(id, new Uri(address));
JsonExtensions.cs (1)
56return new Uri(p.GetString());
ProductCollection.cs (2)
22public static readonly Uri ReleasesIndexDefaultUrl = new Uri("https://builds.dotnet.microsoft.com/dotnet/release-metadata/releases-index.json"); 66return await GetAsync(new Uri(releasesIndexUri)).ConfigureAwait(false);
ReleaseFile.cs (2)
27get => _address ??= _addressString != null ? new Uri(_addressString) : null; 170new ReleaseFile(new Uri(address), hash, name, rid);
Microsoft.DotNet.Cli.Utils (1)
PathUtility.cs (1)
240Uri resultUri = new(new Uri(basePath), new Uri(relativePath, UriKind.Relative));
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\BrowserRefreshServer.cs (1)
84=> new((_lazyHost ?? throw new InvalidOperationException("Server not started")).HttpEndpoints.First(
Microsoft.Extensions.AI.Abstractions (1)
Contents\UriContent.cs (1)
42: this(new Uri(Throw.IfNull(uri)), mediaType)
Microsoft.Extensions.AI.Abstractions.Tests (42)
ChatCompletion\ChatClientMetadataTests.cs (1)
23var uri = new Uri("https://example.com");
ChatCompletion\ChatMessageTests.cs (1)
259new DataContent(new Uri("data:text/plain;base64,aGVsbG8="), "mime-type/2")
Contents\CitationAnnotationTests.cs (3)
59Uri url = new("https://example.com"); 74Url = new("https://example.com"), 130Assert.Equal(new Uri("https://example.com/source"), citation.Url);
Contents\DataContentTests.cs (4)
83content = new DataContent(new Uri("data:text/plain,"), mediaType); 106content = new DataContent(new Uri("data:image/png;base64,aGVsbG8=")); 128Validate(new DataContent(new Uri(uri)), expectedData); 311Assert.Equal(expectedData, new DataContent(new Uri(uri)).Data.ToArray());
Contents\ImageGenerationToolResultContentTests.cs (1)
148Assert.Equal(new Uri("http://example.com/image.png"), uriOutput.Uri);
Contents\UriContentTests.cs (5)
22Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), "")); 23Assert.Throws<ArgumentException>("mediaType", () => new UriContent(new Uri("data:image/png;base64,aGVsbG8="), "audio")); 93var content = new UriContent(new Uri(uri)); 96var content2 = new UriContent(new Uri(uri), null); 239Assert.Equal(new Uri("http://localhost/something"), uriContent.Uri);
Contents\WebSearchToolResultContentTests.cs (10)
33new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "Result 1" } } 56new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "First" } }, 57new UriContent(new Uri("https://example.com/2"), "text/html") { AdditionalProperties = new() { ["title"] = "Second" } }, 58new UriContent(new Uri("https://example.com/3"), "text/html"), 82new UriContent(new Uri("https://example.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Example Page" } }, 83new UriContent(new Uri("https://another.com"), "text/html"), 96Assert.Equal(new Uri("https://example.com"), first.Uri); 100Assert.Equal(new Uri("https://another.com"), second.Uri); 110new UriContent(new Uri("https://test.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Test" } }, 154Assert.Equal(new Uri("https://example.com"), uriResult.Uri);
Embeddings\EmbeddingGeneratorMetadataTests.cs (1)
24var uri = new Uri("https://example.com");
Files\HostedFileClientMetadataTests.cs (2)
24var uri = new Uri("https://api.openai.com"); 41var uri = new Uri("https://api.example.com");
Image\ImageGenerationResponseTests.cs (5)
33content.Add(new UriContent(new Uri($"https://example.com/image-{i}.png"), "image/png")); 73new UriContent(new Uri("https://example.com/image1.png"), "image/png"), 99new UriContent(new Uri("https://example.com/image1.png"), "image/png"), 137new UriContent(new Uri("https://example.com/image.png"), "image/png"), 179Assert.Equal(new Uri("http://example.com/image.png"), uriContent.Uri);
Image\ImageGeneratorMetadataTests.cs (1)
23var uri = new Uri("https://example.com");
SpeechToText\SpeechToTextClientMetadataTests.cs (1)
23var uri = new Uri("https://example.com");
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
99yield return new TestData<Uri>(new("http://example.com"), """{"type":["string","null"], "format":"uri"}""");
TextToSpeech\TextToSpeechClientMetadataTests.cs (1)
23var uri = new Uri("https://example.com");
Tools\HostedMcpServerToolTests.cs (5)
15HostedMcpServerTool tool = new("serverName", new Uri("https://localhost/")); 44HostedMcpServerTool tool = new("serverName", new Uri("https://localhost/"), props); 104HostedMcpServerTool tool = new("serverName", new Uri("https://localhost/")) 125Assert.Throws<ArgumentException>("serverName", () => new HostedMcpServerTool(string.Empty, new Uri("https://localhost/"))); 127Assert.Throws<ArgumentNullException>("serverName", () => new HostedMcpServerTool(null!, new Uri("https://localhost/")));
Microsoft.Extensions.AI.Evaluation.Integration.Tests (3)
Setup.cs (1)
29Endpoint = new Uri(new Uri(Settings.Current.Endpoint), "/openai/v1")
test\Shared\ImageDataUri\ImageDataUri.cs (2)
22return new Uri($"data:image/png;base64,{Convert.ToBase64String(ms.ToArray())}"); 31return new Uri($"data:application/pdf;base64,{Convert.ToBase64String(builder.Build())}");
Microsoft.Extensions.AI.Evaluation.Reporting.Tests (3)
AzureStorage\AzureResponseCacheTests.cs (1)
25baseUri: new Uri(Settings.Current.StorageAccountEndpoint),
AzureStorage\AzureResultStoreTests.cs (1)
25baseUri: new Uri(Settings.Current.StorageAccountEndpoint),
AzureStorage\AzureStoragePathValidationTests.cs (1)
25=> new(new Uri("https://account.dfs.core.windows.net/container/root"));
Microsoft.Extensions.AI.Evaluation.Safety (2)
ContentSafetyService.cs (1)
237Uri discoveryUri = new Uri(discoveryUrl);
ContentSafetyServiceConfiguration.cs (1)
212endpoint: new Uri(Throw.IfNullOrWhitespace(endpointUrl)),
Microsoft.Extensions.AI.Evaluation.Tests (4)
ModelInfoTests.cs (4)
49Uri? uri = providerUri != null ? new Uri(providerUri) : null; 101Uri? uri = providerUri != null ? new Uri(providerUri) : null; 140var metadata = new ChatClientMetadata(providerName, new Uri(providerUri)); 160var metadata = new ChatClientMetadata(providerName: "some-provider", new Uri(providerUri));
Microsoft.Extensions.AI.Integration.Tests (2)
test\Shared\ImageDataUri\ImageDataUri.cs (2)
22return new Uri($"data:image/png;base64,{Convert.ToBase64String(ms.ToArray())}"); 31return new Uri($"data:application/pdf;base64,{Convert.ToBase64String(builder.Build())}");
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (1)
IntegrationTestHelpers.cs (1)
17? new Uri(endpoint)
Microsoft.Extensions.AI.OpenAI (2)
OpenAIClientExtensions.cs (1)
36internal static Uri DefaultOpenAIEndpoint { get; } = new("https://api.openai.com/v1");
OpenAIRealtimeClientSession.cs (1)
681contentParts.Add(new Sdk.RealtimeInputImageMessageContentPart(new Uri(dataContent.Uri)));
Microsoft.Extensions.AI.OpenAI.Tests (39)
IntegrationTestHelpers.cs (1)
31var options = new OpenAIClientOptions { Endpoint = new Uri(new Uri(endpoint), "/openai/v1") };
OpenAIChatClientTests.cs (1)
35Uri endpoint = new("http://localhost/some/endpoint");
OpenAIConversionTests.cs (5)
453new Uri(new DataContent((byte[])[0x89, 0x50, 0x4E, 0x47], "image/png").Uri)); 479Assert.Equal(new Uri("http://localhost:8000"), tool.ServerUri); 542var expectedUri = new Uri("http://localhost:8000"); 891cc.Content.Add(ChatMessageContentPart.CreateImagePart(new Uri("http://example.com/image.png"))); 950ChatMessageContentPart.CreateImagePart(new Uri("http://example.com/image.png"))),
OpenAIEmbeddingGeneratorTests.cs (1)
30Uri endpoint = new("http://localhost/some/endpoint");
OpenAIHostedFileClientTests.cs (3)
48Uri endpoint = new("http://localhost/some/endpoint"); 62Uri endpoint = new("http://localhost/some/endpoint"); 76Uri endpoint = new("http://localhost/some/endpoint");
OpenAIImageGeneratorTests.cs (1)
23Uri endpoint = new("http://localhost/some/endpoint");
OpenAIResponseClientIntegrationTests.cs (4)
193Tools = [new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) { ApprovalMode = HostedMcpServerToolApprovalMode.NeverRequire }], 215Tools = [new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) 255Tools = [new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) 317var mcpTool = new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp"))
OpenAIResponseClientTests.cs (19)
38Uri endpoint = new("http://localhost/some/endpoint"); 1593Tools = [new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp"))] 2090ResponseTool.CreateMcpTool("deepwiki", serverUri: new("https://mcp.deepwiki.com/mcp"), toolCallApprovalPolicy: new McpToolCallApprovalPolicy(DefaultMcpToolCallApprovalPolicy.NeverRequireApproval)).AsAITool() : 2091new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) 2504Tools = [new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) 2710ResponseTool.CreateMcpTool("mymcp", serverUri: new("https://mcp.example.com/mcp"), toolCallApprovalPolicy: new McpToolCallApprovalPolicy(DefaultMcpToolCallApprovalPolicy.NeverRequireApproval)).AsAITool() : 2711new HostedMcpServerTool("mymcp", new Uri("https://mcp.example.com/mcp")) 2820var mcpTool = new HostedMcpServerTool("deepwiki", new Uri("https://mcp.deepwiki.com/mcp")) 3011Uri = new Uri("https://api.openai.com/v1/responses/resp_68d3d2c9ef7c8195863e4e2b2ec226a205007262ecbbfed8"), 3263Uri = new Uri("https://api.openai.com/v1/responses/resp_68d40dc671a0819cb0ee920078333451029e611c3cc4a34b?stream=true&starting_after=9"), 5105new FunctionResultContent("call_uri", new UriContent(new Uri("https://example.com/image.png"), "image/png")) 5224new UriContent(new Uri("https://example.com/result.png"), "image/png"), 5451new FunctionResultContent("call_file_uri", new UriContent(new Uri("https://example.com/document.pdf"), "application/pdf")) 5677new UriContent(new Uri("https://example.com/image.png"), "image/png"), 5678new UriContent(new Uri("https://example.com/image.png"), "image/png") { AdditionalProperties = new AdditionalPropertiesDictionary { ["detail"] = "high" }}, 7636Assert.Equal(new Uri("https://devblogs.microsoft.com/dotnet/announcing-dotnet-10"), source0.Uri); 7641Assert.Equal(new Uri("https://dotnet.microsoft.com/en-us/download/dotnet/10.0"), source1.Uri); 7650Assert.Equal(new Uri("https://devblogs.microsoft.com/dotnet/announcing-dotnet-10?utm_source=openai"), citation.Url); 7776Assert.Equal(new Uri("https://devblogs.microsoft.com/dotnet/announcing-dotnet-10"), streamSource.Uri);
OpenAISpeechToTextClientTests.cs (1)
34Uri endpoint = new("http://localhost/some/endpoint");
OpenAITextToSpeechClientTests.cs (1)
33Uri endpoint = new("http://localhost/some/endpoint");
test\Shared\ImageDataUri\ImageDataUri.cs (2)
22return new Uri($"data:image/png;base64,{Convert.ToBase64String(ms.ToArray())}"); 31return new Uri($"data:application/pdf;base64,{Convert.ToBase64String(builder.Build())}");
Microsoft.Extensions.AI.Stabilization.Tests (11)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\ImageGenerationToolResultContentTests.cs (1)
148Assert.Equal(new Uri("http://example.com/image.png"), uriOutput.Uri);
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\Contents\WebSearchToolResultContentTests.cs (10)
33new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "Result 1" } } 56new UriContent(new Uri("https://example.com/1"), "text/html") { AdditionalProperties = new() { ["title"] = "First" } }, 57new UriContent(new Uri("https://example.com/2"), "text/html") { AdditionalProperties = new() { ["title"] = "Second" } }, 58new UriContent(new Uri("https://example.com/3"), "text/html"), 82new UriContent(new Uri("https://example.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Example Page" } }, 83new UriContent(new Uri("https://another.com"), "text/html"), 96Assert.Equal(new Uri("https://example.com"), first.Uri); 100Assert.Equal(new Uri("https://another.com"), second.Uri); 110new UriContent(new Uri("https://test.com"), "text/html") { AdditionalProperties = new() { ["title"] = "Test" } }, 154Assert.Equal(new Uri("https://example.com"), uriResult.Uri);
Microsoft.Extensions.AI.Tests (18)
ChatCompletion\OpenTelemetryChatClientTests.cs (8)
62serviceType == typeof(ChatClientMetadata) ? new ChatClientMetadata("testservice", new Uri("http://localhost:12345/something"), "amazingmodel") : 411new UriContent(new Uri("https://example.com/image.jpg"), "image/jpeg"), 427yield return new() { Contents = [new UriContent(new Uri("https://example.com/image.jpg"), "image/jpeg")] }; 447new UriContent(new Uri("https://example.com/video.mp4"), "video/mp4"), 664new ImageGenerationToolResultContent("img-123") { Outputs = [new UriContent(new Uri("https://example.com/image.png"), "image/png")] }, 686Outputs = [new UriContent(new Uri("https://example.com/image.png"), "image/png")] 909serviceType == typeof(ChatClientMetadata) ? new ChatClientMetadata("testprovider", new Uri("http://localhost:5000/api"), "testmodel") : 1024serviceType == typeof(ChatClientMetadata) ? new ChatClientMetadata("testservice", new Uri("http://localhost:12345"), "testmodel") :
Embeddings\OpenTelemetryEmbeddingGeneratorTests.cs (2)
53serviceType == typeof(EmbeddingGeneratorMetadata) ? new EmbeddingGeneratorMetadata("testservice", new Uri("http://localhost:12345/something"), "defaultmodel", 1234) : 117serviceType == typeof(EmbeddingGeneratorMetadata) ? new EmbeddingGeneratorMetadata("testservice", new Uri("http://localhost:12345"), "testmodel") :
Files\OpenTelemetryHostedFileClientTests.cs (1)
598serviceType == typeof(HostedFileClientMetadata) ? new HostedFileClientMetadata("testprovider", new Uri("http://localhost:8080/files")) :
Image\OpenTelemetryImageGeneratorTests.cs (2)
61serviceType == typeof(ImageGeneratorMetadata) ? new ImageGeneratorMetadata("testservice", new Uri("http://localhost:12345/something"), "amazingmodel") : 190serviceType == typeof(ImageGeneratorMetadata) ? new ImageGeneratorMetadata("testservice", new Uri("http://localhost:12345"), "testmodel") :
Realtime\OpenTelemetryRealtimeClientTests.cs (1)
46serviceType == typeof(ChatClientMetadata) ? new ChatClientMetadata("testprovider", new Uri("http://localhost:12345/realtime"), "gpt-4-realtime") :
SpeechToText\OpenTelemetrySpeechToTextClientTests.cs (2)
61serviceType == typeof(SpeechToTextClientMetadata) ? new SpeechToTextClientMetadata("testservice", new Uri("http://localhost:12345/something"), "amazingmodel") : 175serviceType == typeof(SpeechToTextClientMetadata) ? new SpeechToTextClientMetadata("testservice", new Uri("http://localhost:12345"), "testmodel") :
TextToSpeech\OpenTelemetryTextToSpeechClientTests.cs (2)
58serviceType == typeof(TextToSpeechClientMetadata) ? new TextToSpeechClientMetadata("testservice", new Uri("http://localhost:12345/something"), "amazingmodel") : 155serviceType == typeof(TextToSpeechClientMetadata) ? new TextToSpeechClientMetadata("testservice", new Uri("http://localhost:12345"), "testmodel") :
Microsoft.Extensions.DataIngestion.Tests (7)
Readers\DocumentReaderConformanceTests.cs (3)
80using HttpResponseMessage response = await DownloadAsync(new(source)); 93FileInfo inputFile = await DownloadToFileAsync(new Uri(source)); 109new("https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MC-SQLR/%5bMC-SQLR%5d.pdf")); // SQL Server Resolution Protocol
Readers\MarkItDownMcpReaderTests.cs (3)
22var reader = new MarkItDownMcpReader(new Uri("http://localhost:3001/sse")); 35var reader = new MarkItDownMcpReader(new Uri("http://localhost:3001/sse")); 44var reader = new MarkItDownMcpReader(new Uri("http://localhost:3001/sse"));
Readers\MarkItDownReaderTests.cs (1)
45new("https://winprotocoldocs-bhdugrdyduf5h2e4.b02.azurefd.net/MC-SQLR/%5bMC-SQLR%5d-240423.docx")); // SQL Server Resolution Protocol.
Microsoft.Extensions.Documents.Abstractions.Tests (16)
DocumentElementTests.cs (1)
242ExtractionDocumentImageElement image = new(new TextContent("")) { Source = new Uri("urn:image:page7"), AlternativeText = "diagram only" };
DocumentImageElementTests.cs (4)
18Uri source = new("urn:image:opaque-7"); 37Source = new Uri("urn:image:opaque-8"), 65Uri source = new("urn:image:opaque-9"); 91Uri source = new("urn:image:page7");
DocumentTableCellCollectionTests.cs (3)
60Uri source = new("urn:table-image:opaque-1"); 146Uri payloadUri = new("urn:mixed-cell:payload"); 147Uri originalAsset = new("urn:mixed-cell:original");
DocumentTests.Composition.cs (1)
87ExtractionDocumentImageElement image = new(new TextContent("")) { Source = new Uri("urn:local:image"), AlternativeText = "local diagram" };
DocumentTests.cs (1)
58Source = new Uri("urn:image:semantic"),
DocumentTests.StandardContent.cs (5)
296new UriContent(new Uri("urn:canonical:image"), "image/png"); 297Uri? source = provenance ? new Uri("urn:provenance:image") : null; 333"image" => new ExtractionDocumentImageElement(payload) { Source = new Uri("urn:must-not-mask-unsupported") }, 367Source = new Uri("urn:provenance:must-not-hide-invalid-type"), 429Source = new Uri("urn:provenance")
PreviewContractTests.cs (1)
121Source = new("urn:original")
Microsoft.Extensions.DotNetDeltaApplier (1)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\WebSocketTransport.cs (1)
59var serverUri = new Uri(serverUrl);
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
NoRemoteCallHandler.cs (1)
24var uri = new Uri(assemblyFileLocation).LocalPath;
NoRemoteCallNotSeekableHandler.cs (1)
27var uri = new Uri(assemblyFileLocation).LocalPath;
Microsoft.Extensions.Http.Diagnostics.Tests (37)
Latency\Internal\HttpLatencyMediatorTests.cs (1)
67req.RequestUri = new Uri($"https://default-uri.com/foo");
Latency\Internal\HttpLatencyTelemetryHandlerTest.cs (1)
61RequestUri = new($"http://default-uri.com/foo")
Logging\AcceptanceTests.cs (4)
25private static readonly Uri _unreachableRequestUri = new("https://we.wont.hit.this.domain.anyway"); 311RequestUri = new Uri(RequestPath), 358RequestUri = new Uri(RequestPath) 423RequestUri = new Uri(RequestPath),
Logging\HttpClientLoggerTest.cs (13)
86RequestUri = new("http://default-uri.com"), 124RequestUri = new("http://default-uri.com"), 186RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 312RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 419RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 516RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 632RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 725RequestUri = new($"http://default-uri.com/foo/bar"), 768RequestUri = new($"http://default-uri.com/foo/bar"), 806RequestUri = new($"http://default-uri.com/foo/bar"), 850RequestUri = new($"http://default-uri.com/foo/bar"), 900RequestUri = new($"http://{expectedLogRecord.Host}/{expectedLogRecord.Path}"), 997RequestUri = new($"http://default-uri.com/foo/bar"),
Logging\HttpRequestReaderTest.cs (15)
86RequestUri = new Uri("https://default-uri.com/foo"), 216RequestUri = new Uri("https://default-uri.com/foo/bar/123"), 292RequestUri = new Uri($"https://{RequestedHost}/foo/bar/123"), 365RequestUri = new Uri("https://default-uri.com/foo/bar/123"), 425RequestUri = new Uri("https://default-uri.com/foo/bar/123"), 498RequestUri = new Uri("https://default-uri.com/foo/bar/123"), 567RequestUri = new Uri("https://default-uri.com/foo/bar/123"), 617RequestUri = new Uri($"https://{RequestedHost}/foo/bar/123") 659var uri = new Uri($"https://{RequestedHost}/api/resource?{queryParamName}={queryParamValue}"); 694var uri = new Uri($"https://{RequestedHost}/api/resource?userId=12345"); 724var uri = new Uri($"https://{RequestedHost}/api/resource?userId=12345"); 760var uri = new Uri($"https://{RequestedHost}/api/resource?userId=12345&token=abc&other=not_logged"); 808var uri = new Uri($"https://{RequestedHost}/api/resource?userId=12345"); 849var uri = new Uri($"https://{RequestedHost}/api/resource?userId="); 895var uri = new Uri($"https://{RequestedHost}/api/orders/{pathParamValue}/details?{queryParamName}={queryParamValue}");
Logging\Internal\NoRemoteCallHandler.cs (1)
20var uri = new Uri(assemblyFileLocation).LocalPath;
Telemetry\HttpDependencyMetadataResolverTests.cs (2)
51RequestUri = new Uri(uriString: urlString) 71RequestUri = new Uri(uriString: urlString)
Microsoft.Extensions.Http.Resilience.PerformanceTests (8)
HedgingBenchmark.cs (1)
15private static readonly Uri _uri = new(HttpClientFactory.PrimaryEndpoint);
HttpClientFactory.cs (4)
90Uri = new Uri(PrimaryEndpoint) 94Uri = new Uri(SecondaryEndpoint) 113Uri = new Uri(PrimaryEndpoint) 117Uri = new Uri(SecondaryEndpoint)
HttpResilienceBenchmark.cs (1)
15private static readonly Uri _uri = new(HttpClientFactory.PrimaryEndpoint);
RetryBenchmark.cs (1)
19private static readonly Uri _uri = new(HttpClientFactory.PrimaryEndpoint);
StandardResilienceBenchmark.cs (1)
19private static readonly Uri _uri = new(HttpClientFactory.PrimaryEndpoint);
Microsoft.Extensions.Http.Resilience.Tests (17)
Hedging\HedgingTests.cs (1)
371uri = new Uri(string.Format(CultureInfo.InvariantCulture, pattern, attemptCount));
Hedging\StandardHedgingTests.cs (2)
317Endpoints = [new WeightedUriEndpoint { Uri = new Uri($"https://{FailingEndpoint}:3000") }] 322Endpoints = [new WeightedUriEndpoint { Uri = new Uri("https://microsoft.com") }]
Resilience\RequestMessageSnapshotTests.cs (2)
23RequestUri = new Uri("https://dummy-uri.com?query=param"), 57RequestUri = new Uri("https://dummy-uri.com?query=param"),
Resilience\UriExtensionsTests.cs (6)
25var fallbackUri = new Uri("https://fallback-uri.com"); 26var initialUri = new Uri(initialUriString); 28initialUri.ReplaceHost(fallbackUri).Should().Be(new Uri(expectedUriString)); 40var initialUri = new Uri(initialUriString); 44initialUri.ReplaceHost(new Uri(replacementUri)).Should().BeSameAs(initialUri); 48initialUri.ReplaceHost(new Uri(replacementUri)).Should().NotBeSameAs(initialUri);
Routing\EndpointTests.cs (2)
17Uri = new Uri("https://localhost:5001") 20endpoint.Uri.Should().Be(new Uri("https://localhost:5001"));
Routing\OrderedRoutingStrategyTest.cs (3)
62CreateGroup(new WeightedUriEndpoint { Uri = new Uri("https://b/"), Weight = 20 }), 70options.Groups.Add(CreateGroup(new WeightedUriEndpoint { Uri = new Uri("https://c/"), Weight = 30 })); 109return CreateGroup(endpoints.Select(v => new WeightedUriEndpoint { Uri = new Uri(v) }).ToArray());
Routing\WeightedRoutingStrategyTest.cs (1)
169return CreateGroup(endpoints.Select(v => new WeightedUriEndpoint { Uri = new Uri(v) }).ToArray());
Microsoft.Extensions.ML (4)
Builder\BuilderExtensions.cs (4)
29return builder.FromUri(string.Empty, new Uri(uri)); 51return builder.FromUri(modelName, new Uri(uri)); 91return builder.FromUri(string.Empty, new Uri(uri), period); 116return builder.FromUri(modelName, new Uri(uri), period);
Microsoft.Extensions.ML.Tests (2)
UriLoaderTests.cs (2)
48loaderUnderTest.Start(new Uri("https://microsoft.com"), TimeSpan.FromMilliseconds(1)); 70loaderUnderTest.Start(new Uri("https://microsoft.com"), TimeSpan.FromMilliseconds(1));
Microsoft.Extensions.ServiceDiscovery.Tests (17)
ConfigurationServiceEndpointResolverTests.cs (13)
102Assert.Equal(new UriEndPoint(new Uri("https://localhost")), ep.EndPoint); 117Assert.Equal(new UriEndPoint(new Uri("https://localhost")), ep.EndPoint); 132Assert.Equal(new UriEndPoint(new Uri("https://localhost")), ep.EndPoint); 172Assert.Equal(new UriEndPoint(new Uri("https://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint); 194Assert.Equal(new UriEndPoint(new Uri("https://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint); 209Assert.Equal(new UriEndPoint(new Uri("https://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint); 265Assert.Equal(new UriEndPoint(new Uri(expectedResult)), initialResult.EndpointSource.Endpoints[0].EndPoint); 303Assert.Equal(new UriEndPoint(new Uri("http://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint); 304Assert.Equal(new UriEndPoint(new Uri("http://remotehost:9090")), initialResult.EndpointSource.Endpoints[1].EndPoint); 325Assert.Equal(new UriEndPoint(new Uri("http://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint); 326Assert.Equal(new UriEndPoint(new Uri("http://remotehost:9090")), initialResult.EndpointSource.Endpoints[1].EndPoint); 372Assert.Equal(new UriEndPoint(new Uri("http://remotehost:4444")), initialResult.EndpointSource.Endpoints[2].EndPoint); 421Assert.Equal(new UriEndPoint(new Uri("https://remotehost:5555")), initialResult.EndpointSource.Endpoints[2].EndPoint);
PassThroughServiceEndpointResolverTests.cs (1)
72Assert.Equal(new UriEndPoint(new Uri("http://localhost:8080")), initialResult.EndpointSource.Endpoints[0].EndPoint);
ServiceEndpointResolverTests.cs (1)
60serviceCollection.AddHttpClient("foo", c => c.BaseAddress = new("http://foo")).AddServiceDiscovery();
ServiceEndpointTests.cs (2)
15(EndPoint)new UriEndPoint(new Uri("https://microsoft.com")) 22(EndPoint)new UriEndPoint(new Uri("https://microsoft.com:8443"))
Microsoft.Extensions.ServiceDiscovery.Yarp (4)
ServiceDiscoveryDestinationResolver.cs (4)
57var originalUri = new Uri(originalConfig.Address); 63var healthUri = originalConfig.Health is { Length: > 0 } health ? new Uri(health) : null; 72uri = new Uri($"{scheme}://{addressString}"); 76uri = new Uri(addressString);
Microsoft.Gen.Logging.Generated.Tests (1)
LogPropertiesTests.cs (1)
95P5 = new Uri("https://www.microsoft.com"),
Microsoft.Maui (2)
Handlers\HybridWebView\HybridWebViewHandler.cs (1)
66 internal static readonly Uri AppOriginUri = new(AppOrigin);
Handlers\HybridWebView\HybridWebViewQueryStringHelper.cs (1)
35 var query = new Uri(url).Query;
Microsoft.Maui.Controls (2)
Shell\ShellUriHandler.cs (2)
160 return new Uri(uri); 794 return new Uri($"{Shell.RouteScheme}://{uri}");
Microsoft.Maui.Essentials (7)
Browser\Browser.shared.cs (3)
96 browser.OpenAsync(new Uri(uri), new BrowserLaunchOptions()); 106 browser.OpenAsync(new Uri(uri), new BrowserLaunchOptions { LaunchMode = launchMode }); 116 browser.OpenAsync(new Uri(uri), options);
Launcher\Launcher.shared.cs (3)
187 launcher.CanOpenAsync(new Uri(uri)); 197 launcher.OpenAsync(new Uri(uri)); 207 launcher.TryOpenAsync(new Uri(uri));
Types\Shared\WebUtils.shared.cs (1)
87 return new Uri(uri.Scheme + "://" + idn.GetAscii(uri.Authority) + uri.PathAndQuery + uri.Fragment);
Microsoft.ML.AutoML.Tests (1)
DatasetUtil.cs (1)
199destFileName = Path.GetFileName(new Uri(url).AbsolutePath); ;
Microsoft.ML.Core (1)
Utilities\ResourceManagerUtils.cs (1)
160var t = Task.Run(() => DownloadResource(env, ch, client, new Uri(url), filePath, fileName, downloadCancel.Token));
Microsoft.ML.Parquet (3)
PartitionedPathUtils.cs (3)
26Uri baseUri = new Uri(basepath); 27Uri uri = new Uri(path); 39baseUri = new Uri(baseUri.AbsoluteUri + "/");
Microsoft.ML.Samples (5)
Dynamic\TensorFlow\ImageClassification.cs (1)
125var response = await client.GetStreamAsync(new Uri($"{baseGitPath}")).ConfigureAwait(false);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
274var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
Dynamic\Trainers\MulticlassClassification\ImageClassification\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
306var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
262var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
283var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
Microsoft.ML.Samples.GPU (5)
parent\6a273e5f1a281752\LearningRateSchedulingCifarResnetTransferLearning.cs (1)
306var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
parent\Microsoft.ML.Samples\Dynamic\TensorFlow\ImageClassification.cs (1)
125var response = await client.GetStreamAsync(new Uri($"{baseGitPath}")).ConfigureAwait(false);
parent\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ImageClassificationDefault.cs (1)
274var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
parent\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningEarlyStopping.cs (1)
262var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
parent\Microsoft.ML.Samples\Dynamic\Trainers\MulticlassClassification\ImageClassification\ResnetV2101TransferLearningTrainTestSplit.cs (1)
283var response = await client.GetStreamAsync(new Uri($"{url}")).ConfigureAwait(false);
Microsoft.ML.SamplesUtils (1)
SamplesDatasetUtils.cs (1)
198var response = await client.GetStreamAsync(new Uri($"{baseGitPath}")).ConfigureAwait(false);
Microsoft.NET.Build.Containers (4)
AuthHandshakeMessageHandler.cs (1)
269return new Uri($"container://{registryName}").Port != -1;
FallbackToHttpMessageHandler.cs (1)
85return new Uri($"container://{registryName}").Port != -1;
Registry\Registry.cs (2)
94this(new Uri($"https://{registryName}"), logger, registryAPI, settings, retryDelayProvider) 98this(new Uri($"https://{registryName}"), logger, new RegistryApiFactory(mode), settings)
Microsoft.NET.Sdk.Publish.Tasks (6)
MsDeploy\CommonUtility.cs (1)
814Uri uri = new(physicalPath);
Tasks\MsDeploy\ImportParameterFile.cs (1)
190Uri sourceUri = new(ex.SourceUri);
Tasks\OneDeploy\DeploymentResponse.cs (1)
85Uri logUrl = new(deploymentResponse.LogUrl);
Tasks\Xdt\TransformXml.cs (1)
146Uri sourceUri = new(ex.SourceUri);
Tasks\ZipDeploy\DeploymentResponse.cs (1)
33Uri logUrl = new(deploymentResponse.LogUrl);
WebConfigTelemetry.cs (1)
108projectFullPathConstructed = Path.GetFullPath((new Uri(projectFullPathConstructed)).LocalPath);
Microsoft.SourceLink.AzureDevOpsServer.Git (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.AzureRepos.Git (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.Bitbucket.Git (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.Gitea (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.Gitee (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.GitHub (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.GitLab (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.SourceLink.GitWeb (1)
src\sourcelink\src\Common\GitProvider\GetSourceLinkUrlGitTask.cs (1)
266contentUri = new Uri($"{contentUri.Scheme}://{contentUri.Host}:{repoUri.Port}{contentUri.PathAndQuery}");
Microsoft.TemplateSearch.Common (3)
Providers\NuGetMetadataSearchProvider.cs (3)
31new Uri("https://go.microsoft.com/fwlink/?linkid=2168770&clcid=0x409"), //v2 search cache 32new Uri("https://go.microsoft.com/fwlink/?linkid=2087906&clcid=0x409") //v1 search cache 57_searchMetadataUris = searchCacheUri.Select(s => new Uri(s)).ToArray();
Microsoft.TestPlatform.CommunicationUtilities (4)
Serialization\AttachmentConverters.cs (2)
25var uri = new Uri(element.GetProperty("Uri").GetString()!); 65var uri = new Uri(element.GetProperty("Uri").GetString()!);
Serialization\TestCaseConverter.cs (1)
78testCase.ExecutorUri = new Uri(propertyData!); break;
Serialization\TestCaseConverterV2.cs (1)
32testCase.ExecutorUri = new Uri(uri.GetString()!);
Microsoft.TestPlatform.CrossPlatEngine (1)
Client\TestLoggerManager.cs (1)
415loggerUri = new Uri(extension.Metadata.ExtensionUri);
Microsoft.TestPlatform.Utilities (1)
CodeCoverageDataAttachmentsHandler.cs (1)
34private static readonly Uri CodeCoverageDataCollectorUri = new(CoverageUri);
Microsoft.VisualBasic.Forms (1)
Microsoft\VisualBasic\Devices\NetworkUtilities.vb (1)
96Return New Uri(address)
Microsoft.VisualStudio.TestPlatform.Common (3)
DataCollection\DataCollectorConfig.cs (1)
90return new Uri(typeUriAttribute.TypeUri);
ExtensionFramework\TestDiscoveryExtensionManager.cs (1)
172DefaultExecutorUri = new Uri(defaultExecutorUri);
ExtensionFramework\TestExtensionManager.cs (1)
147uri = new Uri(extension.Metadata.ExtensionUri);
Microsoft.VisualStudio.TestPlatform.ObjectModel (3)
DataCollector\DataCollectorSettings.cs (1)
160settings.Uri = new Uri(reader.Value);
Logger\LoggerSettings.cs (1)
145settings.Uri = new Uri(reader.Value);
TestCase.cs (1)
311ExecutorUri = value as Uri ?? new Uri((value as string)!);
Microsoft.Web.XmlTransform (1)
XmlTransformationLogger.cs (1)
226Uri uri = new Uri(fileName);
MyFrontend (3)
Components\NavigationManagerExtensions.cs (1)
13return new Uri(uri).PathAndQuery;
Program.cs (2)
11builder.Services.AddHttpClient<CatalogServiceClient>(c => c.BaseAddress = new("https+http://catalogservice")); 16.AddGrpcClient<Basket.BasketClient>(o => o.Address = new($"{(isHttps ? "https" : "http")}://basketservice"));
NativeIntegrations.DockerCompose (2)
DockerComposeBuilderExtensions.cs (2)
80public Uri PrimaryEndpoint => new($"http://{(environment.Resource.DashboardHostPort is null ? ServiceName(Name) : "127.0.0.1")}:{environment.Resource.DashboardHostPort ?? 18888}"); 81public Uri OtlpGrpcEndpoint => new($"http://{ServiceName(Name)}:18889");
NuGet.Commands (1)
SignCommand\SignCommandRunner.cs (1)
175timestampProvider = new Rfc3161TimestampProvider(new Uri(timestamper));
NuGet.Common (1)
PathUtil\PathUtility.cs (1)
292Uri resultUri = new Uri(new Uri(basePath), new Uri(relativePath, UriKind.Relative));
NuGet.Configuration (1)
Proxy\WebProxy.cs (1)
102return new Uri(address);
NuGet.Credentials (1)
CredentialService.cs (1)
232return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
NuGet.PackageManagement (2)
Utility\PackagesConfigLockFileUtility.cs (2)
59var projectUri = new Uri(msbuildProject.MSBuildProjectPath); 60var lockFileUri = new Uri(lockFileName);
NuGet.Packaging (10)
PackageCreation\Authoring\LicenseMetadata.cs (3)
20public static readonly Uri LicenseFileDeprecationUrl = new Uri("https://aka.ms/deprecateLicenseUrl"); 104return new Uri(GenerateLicenseServiceLink(License)); 114return new Uri(string.Format(CultureInfo.InvariantCulture, LicenseServiceLinkTemplate, license)).AbsoluteUri;
PackageCreation\Authoring\ManifestMetadata.cs (3)
121return new Uri(_iconUrl); 141return new Uri(_licenseUrl); 159return new Uri(_projectUrl);
PackageCreation\Authoring\PackageBuilder.cs (1)
29private static readonly Uri DefaultUri = new Uri("http://defaultcontainer/");
Rules\DefaultManifestValuesRule.cs (3)
14internal static readonly Uri SampleProjectUrl = new Uri("http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE"); 15internal static readonly Uri SampleLicenseUrl = new Uri("http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE"); 16internal static readonly Uri SampleIconUrl = new Uri("http://ICON_URL_HERE_OR_DELETE_THIS_LINE");
NuGet.Protocol (23)
Converters\ParserConstants.cs (8)
10public static readonly Uri PackageSearchResult = new Uri("http://schema.nuget.org/schema#PackageSearchResult"); 11public static readonly Uri PackageIdentity = new Uri("http://schema.nuget.org/schema#PackageIdentity"); 12public static readonly Uri PackageDescription = new Uri("http://schema.nuget.org/schema#PackageDescription"); 13public static readonly Uri PackageLicensing = new Uri("http://schema.nuget.org/schema#PackageLicensing"); 14public static readonly Uri PackageDependencies = new Uri("http://schema.nuget.org/schema#PackageDependencies"); 15public static readonly Uri DependencyGroup = new Uri("http://schema.nuget.org/schema#DependencyGroup"); 16public static readonly Uri Dependency = new Uri("http://schema.nuget.org/schema#Dependency"); 17public static readonly Uri Stats = new Uri("http://schema.nuget.org/schema#Stats");
DependencyInfo\ResolverMetadataClient.cs (1)
251PackageContent = new Uri(item.ContentUri)
HttpSource\TokenStore.cs (1)
67return new Uri(uri.GetComponents(UriComponents.SchemeAndServer, UriFormat.SafeUnescaped));
LegacyFeed\DependencyInfoResourceV2Feed.cs (1)
123packageVersion.DownloadUrl != null ? new Uri(packageVersion.DownloadUrl) : null,
LegacyFeed\V2FeedParser.cs (1)
302new Uri(packageInfo.DownloadUrl!),
Providers\PackageUpdateResourceV3Provider.cs (1)
37if (!(new Uri(sourceUri)).IsFile)
Providers\SymbolPackageUpdateResourceV3Provider.cs (1)
34if (!(new Uri(sourceUri)).IsFile)
RemoteRepositories\HttpFileSystemBasedFindPackageByIdResource.cs (1)
84.Select(uri => uri.OriginalString.EndsWith("/", StringComparison.Ordinal) ? uri : new Uri(uri.OriginalString + "/"))
Resources\DownloadResourceV3.cs (2)
99downloadUri = new Uri(url); 139return new Uri(blob["packageContent"]!.ToString());
Resources\OwnerDetailsUriTemplateResourceV3.cs (1)
58return new Uri(uriString);
Resources\PackageDetailsUriResourceV3.cs (1)
62return new Uri(uriString);
Resources\RegistrationResourceV3.cs (2)
59return new Uri(string.Format(CultureInfo.InvariantCulture, "{0}/{1}/index.json", 95return new Uri(string.Format(CultureInfo.InvariantCulture, "{0}/{1}/{2}.json", BaseUri.AbsoluteUri.TrimEnd('/'),
Resources\ReportAbuseResourceV3.cs (1)
46return new Uri(uriString);
Utility\OfflineFeedUtility.cs (1)
102pathUri = new Uri(path);
Pipelines.AppHost (1)
AppHost.cs (1)
281var fileShareUri = new Uri($"https://{storageAccountName}.file.core.windows.net/{fileShareName}");
PresentationBuildTasks (2)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\ParserContext.cs (1)
460Uri sameUri = new Uri(serializedSafe);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\ResourceIDHelper.cs (1)
24Uri baseUri = new Uri("http://foo/");
PresentationCore (20)
MS\Internal\AppModel\SiteOfOriginContainer.cs (1)
42Uri siteOfOrigin = BaseUriHelper.FixFileUri(new Uri(System.AppDomain.CurrentDomain.BaseDirectory));
MS\Internal\FontCache\DWriteFactory.cs (1)
83return DWriteFactory.Instance.GetFontCollection(new Uri(localPath));
MS\Internal\FontCache\FamilyCollection.cs (1)
111Uri criticalSxSFontsLocation = new Uri(FamilyCollection.SxSFontsResourcePrefix);
MS\Internal\FontCache\FontCacheUtil.cs (5)
499fontSourceUri = new Uri(fontUri.GetComponents(Util.UriWithoutFragment, UriFormat.SafeUnescaped)); 512return new Uri(fontUri); 516string canonicalPathUri = new Uri(fontUri).GetComponents(UriComponents.AbsoluteUri, UriFormat.SafeUnescaped); 518return new Uri(canonicalPathUri + '#' + faceIndexString); 837throw new FileFormatException(new Uri(fileName));
MS\Internal\FontCache\FontSource.cs (1)
28return new FontSource(new Uri(uriString));
MS\Internal\FontCache\FontSourceCollection.cs (1)
23return new FontSourceCollection(new Uri(uriString));
MS\Internal\WpfWebRequestHelper.cs (1)
71uri = new Uri(uri.GetLeftPart(UriPartial.Path));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\MimeTypeMapper.cs (1)
28uri = new Uri("http://foo/bar/");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SecurityHelper.cs (1)
71appBase = new Uri(domain.BaseDirectory);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\WinInet.cs (1)
46return new Uri(icci.CachePath);
System\Windows\Media\ColorContext.cs (1)
579profilePath = new Uri(Path.Combine(buffer.ToString(), profilePathString));
System\Windows\Media\GlyphTypeface.cs (1)
96Uri typefaceSource = new Uri(uriPath);
System\Windows\Navigation\BaseUriHelper.cs (4)
25private static readonly Uri _siteOfOriginBaseUri = PackUriHelper.Create(new Uri(SOOBASE)); 27private static readonly Uri _packAppBaseUri = PackUriHelper.Create(new Uri(APPBASE)); 352return (new Uri(sUri.GetComponents(UriComponents.SchemeAndServer, UriFormat.UriEscaped))).MakeRelativeUri(sUri); 385return new Uri(uri.AbsoluteUri);
PresentationFramework (18)
MS\Internal\Controls\WebBrowserEvent.cs (3)
58Uri source = String.IsNullOrEmpty(urlString) ? null : new Uri(urlString); 197Uri source = string.IsNullOrEmpty(urlString) ? null : new Uri(urlString); 225Uri source = string.IsNullOrEmpty(urlString) ? null : new Uri(urlString);
MS\Internal\Utility\BindUriHelper.cs (1)
23private static Uri placeboBase = new Uri(PLACEBOURI);
System\Windows\Annotations\Storage\XmlStreamStore.cs (3)
48_predefinedNamespaces.Add(new Uri(AnnotationXmlConstants.Namespaces.CoreSchemaNamespace), null); 49_predefinedNamespaces.Add(new Uri(AnnotationXmlConstants.Namespaces.BaseSchemaNamespace), null); 50_predefinedNamespaces.Add(new Uri(XamlReaderHelper.DefaultNamespaceURI), null);
System\Windows\Controls\WebBrowser.cs (3)
144Uri uri = new Uri(source); 380return (string.IsNullOrEmpty(urlString) ? null : new Uri(urlString)); 861source = new Uri(AboutBlankUriString);
System\Windows\Documents\FixedPage.cs (1)
629workuri = new Uri(new Uri("http://microsoft.com/"), inputUri);
System\Windows\Documents\Serialization\SerializerDescriptor.cs (1)
162sd._manufacturerWebsite = new Uri(GetNonEmptyRegistryString(key, "manufacturerWebsite"));
System\Windows\Documents\Speller.cs (2)
1535fileUri = new Uri(new Uri($"{Directory.GetCurrentDirectory()}/"), uri); 1611return new Uri(tmpFilePath);
System\Windows\Markup\ParserContext.cs (2)
132BaseUri = new Uri( xmlReader.BaseURI ); 460Uri sameUri = new Uri(serializedSafe);
System\Windows\Markup\XamlReader.cs (2)
338parserContext.BaseUri = new Uri(reader.BaseURI); 900parserContext.BaseUri = new Uri(reader.BaseURI);
PresentationUI (6)
MS\Internal\Documents\Application\AddressUtility.cs (1)
67return new Uri(string.Format(
MS\Internal\Documents\Application\DocumentStream.cs (1)
827return new Uri(temp);
MS\Internal\Documents\Application\FilePresentation.cs (1)
92Uri file = new Uri(filePath);
MS\Internal\Documents\RightsManagementManager.cs (1)
639NavigationHelper.NavigateToExternalUri(new Uri(rmClientInstallLocation));
MS\Internal\Documents\RMPublishingDialog.cs (2)
346newUri = new Uri(path); 389templateList.Add(new Uri(file.FullName));
Publishers.Frontend (1)
Program.cs (1)
9builder.Services.AddHttpClient<ApiClient>(c => c.BaseAddress = new("http://api"));
ReachFramework (5)
Packaging\XpsDocument.cs (1)
167Uri = new Uri( new Uri(Directory.GetCurrentDirectory()+"/"), this.Uri );
Packaging\XpsManager.cs (2)
118_uri = new Uri( new Uri(Directory.GetCurrentDirectory()+"/"), path ); 1507Uri dummyAbsoluteUri = new Uri("http://dummy");
Serialization\ImageSourceTypeConverter.cs (1)
229Uri sourceUri = new Uri(decoder.ToString());
SerializerFactory\XpsSerializerFactory.cs (1)
67return new Uri(SR.XpsSerializerFactory_ManufacturerWebsite);
Security.TransportSecurity.IntegrationTests (34)
Https\HttpsTests.4.1.0.cs (5)
240endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_DefaultBinding_Address_Text)); 287endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_DefaultBinding_Address_Text), identity); 327endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_DefaultBinding_Address_Text), identity); 366endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_ClientCertificateAuth_Address)); 414endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_ClientCertificateAuth_Address));
Https\HttpsTests.4.1.1.cs (4)
40new Uri(Endpoints.Https_SecModeTrans_ClientCredTypeNone_ServerCertValModePeerTrust_Address)); 90endpointAddress = new EndpointAddress(new Uri( 149new Uri(Endpoints.Https_SecModeTrans_ClientCredTypeNone_ServerCertValModeChainTrust_Address)); 199endpointAddress = new EndpointAddress(new Uri(Endpoints.Https_SecModeTrans_ClientCredTypeNone_ServerCertValModeChainTrust_Address));
Negotiate\NegotiateStream_Http_Tests.4.1.0.cs (5)
188new EndpointAddress(new Uri(Endpoints.Https_WindowsAuth_Address), new SpnEndpointIdentity(spn))); 239new Uri(Endpoints.Https_WindowsAuth_Address), 283new Uri(Endpoints.Https_WindowsAuth_Address), 336new Uri(Endpoints.Https_WindowsAuth_Address), 386new Uri(Endpoints.Https_WindowsAuth_Address),
Negotiate\NegotiateStream_Tcp_Tests.4.1.0.cs (4)
161new Uri(Endpoints.Tcp_DefaultBinding_Address), 201new Uri(Endpoints.Tcp_DefaultBinding_Address), 252new Uri(Endpoints.Tcp_DefaultBinding_Address), 300new Uri(Endpoints.Tcp_DefaultBinding_Address),
Tcp\ClientCredentialTypeCertificateCanonicalNameTests.4.1.0.cs (4)
33var localhostEndpointUri = new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_With_CanonicalName_Localhost_Address); 105var domainNameEndpointUri = new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_With_CanonicalName_DomainName_Address); 183var domainNameEndpointUri = new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_With_CanonicalName_DomainName_Address); 187var fqdnEndpointUri = new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_With_CanonicalName_Fqdn_Address);
Tcp\ClientCredentialTypeTests.4.1.0.cs (3)
32endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_Address), 80endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_CustomValidation_Address), 132endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_ClientCredentialType_Certificate_With_ServerAltName_Address));
Tcp\ClientCredentialTypeTests.4.1.1.cs (5)
40new Uri(Endpoints.NetTcp_SecModeTrans_ClientCredTypeNone_ServerCertValModePeerTrust_Address)); 89endpointAddress = new EndpointAddress(new Uri( 146endpointAddress = new EndpointAddress(new Uri( 192endpointAddress = new EndpointAddress(new Uri( 241endpointAddress = new EndpointAddress(new Uri(
Tcp\ClientCredentialTypeTests.OSX.cs (1)
66new Uri(Endpoints.NetTcp_SecModeTrans_ClientCredTypeNone_ServerCertValModePeerTrust_Address));
Tcp\IdentityTests.4.1.0.cs (1)
29EndpointAddress endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_VerifyDNS_Address), new DnsEndpointIdentity(Endpoints.Tcp_VerifyDNS_HostName));
Tcp\IdentityTests.4.1.1.cs (1)
29EndpointAddress endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_VerifyDNS_Address), new DnsEndpointIdentity("wrongone"));
Tcp\SctRenewalRegressionTests.cs (1)
59endpointAddress = new EndpointAddress(new Uri(Endpoints.Tcp_SecModeTransWithMessCred_ClientCredTypeCert_Renew));
Shared.Tests (3)
ImageDataUri\ImageDataUri.cs (2)
22return new Uri($"data:image/png;base64,{Convert.ToBase64String(ms.ToArray())}"); 31return new Uri($"data:application/pdf;base64,{Convert.ToBase64String(builder.Build())}");
JsonSchemaExporter\TestTypes.cs (1)
99yield return new TestData<Uri>(new("http://example.com"), """{"type":["string","null"], "format":"uri"}""");
StandardService (1)
Program.cs (1)
5client.BaseAddress = new Uri("https+http://azure-functions-service");
System.ComponentModel.TypeConverter (1)
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
54Uri uri = new Uri(fileName);
System.Data.Common (3)
System\Data\Common\ObjectStorage.cs (1)
337return (new Uri(s));
System\Data\Common\SQLConvert.cs (2)
548return new Uri((string)value); 636return new Uri((string)value);
System.Diagnostics.EventLog (1)
System\Diagnostics\Reader\ProviderMetadata.cs (1)
123return new Uri(helpLinkStr);
System.DirectoryServices.Protocols (5)
System\DirectoryServices\Protocols\common\DirectoryResponse.cs (1)
59tempReferral[i] = new Uri(_directoryReferral[i].AbsoluteUri);
System\DirectoryServices\Protocols\common\SearchResults.cs (1)
26tempUri[i] = new Uri(_resultReferences[i].AbsoluteUri);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (2)
1639responseReferral[j] = new Uri((string)referralList[j]); 1842uris[i] = new Uri((string)referralList[i]);
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (1)
637responseReferral[j] = new Uri((string)referralList[j]);
System.IO.IsolatedStorage (1)
System\IO\IsolatedStorage\Helper.cs (1)
132Uri locationUri = new Uri(location);
System.IO.Packaging (5)
System\IO\Packaging\PackUriHelper.cs (1)
571private static readonly Uri s_defaultUri = new Uri("http://defaultcontainer/");
System\IO\Packaging\PackUriHelper.PackUriScheme.cs (4)
104Uri packUri = new Uri(absolutePackageUri); 112packUri = new Uri(string.Concat(packUri.GetComponents(UriComponents.AbsoluteUri, UriFormat.UriEscaped), fragment)); 118return new Uri(packUri.GetComponents(UriComponents.AbsoluteUri, UriFormat.UriEscaped)); 307Uri packageUri = new Uri(Uri.UnescapeDataString(hostAndPort));
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs (1)
258uri = new Uri($"{uriSpan[tokens[0]]}//:@{uriSpan[tokens[2]]}");
System.Net.Http.WinHttpHandler (1)
System\Net\Http\WinHttpRequestCallback.cs (1)
101var redirectUri = new Uri(Marshal.PtrToStringUni(statusInformation)!);
System.Net.HttpListener (1)
System\Net\ServiceNameStore.cs (1)
222Uri hostUri = new Uri(uriPrefix);
System.Net.Mail (1)
System\Net\Mail\SmtpClient.cs (1)
284return _servicePoint ??= ServicePointManager.FindServicePoint(new Uri($"mailto:{_host}:{_port}"));
System.Net.Requests (3)
System\Net\ServicePoint\ServicePointManager.cs (1)
105public static ServicePoint FindServicePoint(string uriString, IWebProxy? proxy) => FindServicePoint(new Uri(uriString), proxy);
System\Net\WebRequest.cs (2)
156return Create(new Uri(requestUriString), false); 201return CreateHttp(new Uri(requestUriString));
System.Net.Security (1)
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
184Uri uri = new Uri(uriString);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
289var proxyUri = new Uri(address);
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\Globals.cs (1)
35internal static Uri DataContractXsdBaseNamespaceUri => field ??= new Uri(DataContractXsdBaseNamespace);
System.Private.Uri (2)
System\UriBuilder.cs (2)
36_uri = new Uri(Uri.UriSchemeHttp + Uri.SchemeDelimiter + uri); 265_uri = new Uri(ToString());
System.Private.Xml (3)
System\Xml\XmlResolver.cs (1)
48uri = new Uri(Path.GetFullPath(relativeUri!));
System\Xml\Xsl\Runtime\XmlCollation.cs (2)
169collationUri = new Uri(collationLiteral); 202else if (collationUri.IsBaseOf(new Uri(XmlReservedNs.NsCollCodePoint)))
System.Runtime.Serialization.Schema (1)
System\Runtime\Serialization\Schema\ImportGlobals.cs (1)
87internal static Uri DataContractXsdBaseNamespaceUri => field ??= new Uri(DataContractXsdBaseNamespace);
System.Security.Cryptography (1)
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
184Uri uri = new Uri(uriString);
System.ServiceModel.Federation.Tests (2)
WSTrustChannelSecurityTokenProviderTest.cs (2)
28var issuerAddress = new EndpointAddress(new Uri("http://localhost/issuer.svc")); 29var targetAddress = new EndpointAddress(new Uri("http://localhost/target.svc"));
System.ServiceModel.Http (1)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1232_httpRequestMessage.Headers.Referrer = new Uri(value);
System.ServiceModel.Http.Tests (2)
ServiceModel\HttpIdentityTests.cs (2)
15var endpointAddress = new EndpointAddress(new Uri("https://serverhostname/fakeService.svc"), identity); 27var endpointAddress = new EndpointAddress(new Uri("https://serverhostname/fakeService.svc"), identity);
System.ServiceModel.NetFramingBase (5)
System\ServiceModel\Channels\AddressingVersionExtensions.cs (3)
21"Addressing200408 (http://schemas.xmlsoap.org/ws/2004/08/addressing)" => new Uri("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"), 22"Addressing10 (http://www.w3.org/2005/08/addressing)" => new Uri("http://www.w3.org/2005/08/addressing/anonymous"), 35"Addressing10 (http://www.w3.org/2005/08/addressing)" => new Uri("http://www.w3.org/2005/08/addressing/none"),
System\ServiceModel\Channels\FramingChannels.cs (1)
29: this(factory, settings, s_anonymousEndpointAddress, settings.MessageVersion.Addressing == AddressingVersion.None ? null : new Uri("http://www.w3.org/2005/08/addressing/anonymous"),
System\ServiceModel\Channels\FramingDecoders.cs (1)
231_via = new Uri(value);
System.ServiceModel.Primitives (10)
System\IdentityModel\Claims\X509CertificateClaimSet.cs (1)
223claims.Add(Claim.CreateUriClaim(new Uri(value)));
System\ServiceModel\Channels\Addressing.cs (2)
477return new Uri(toString); 794internal static readonly Uri ReplyRelationshipType = new Uri(Addressing10Strings.ReplyRelationship);
System\ServiceModel\Channels\AddressingVersion.cs (2)
38AnonymousUri = new Uri(anonymous); 43_noneUri = new Uri(none);
System\ServiceModel\Channels\BinaryMessageEncoder.cs (1)
1428_toHeader = ToHeader.Create(new Uri(toString.Value), _messageVersion.Addressing);
System\ServiceModel\Channels\Message.cs (1)
2225uri = new Uri(uriString);
System\ServiceModel\EndpointAddress.cs (3)
94Uri u = new Uri(uri); 219s_anonymousUri = new Uri(AddressingStrings.AnonymousUri); 232s_noneUri = new Uri(AddressingStrings.NoneUri);
System.Speech (7)
Internal\SrgsCompiler\SRGSCompiler.cs (1)
46uri = new Uri(xmlReaders[iReader].BaseURI);
Internal\SrgsParser\XmlParser.cs (2)
34uri = new Uri(_xmlTextReader.BaseURI); 379grammar.XmlBase = new Uri(reader.Value);
Recognition\DictationGrammar.cs (1)
53private static readonly Uri s_defaultDictationUri = new("grammar:dictation");
Recognition\SrgsGrammar\SrgsDocument.cs (1)
320_baseUri = new Uri(srgsGrammar.BaseURI);
Recognition\SrgsGrammar\SrgsRuleRef.cs (2)
120public static readonly SrgsRuleRef Dictation = new(new Uri("grammar:dictation")); 121public static readonly SrgsRuleRef MnemonicSpelling = new(new Uri("grammar:dictation#spelling"));
System.Windows.Extensions (2)
System\Media\SoundPlayer.cs (2)
352result = new Uri(partialUri); 364result = new Uri(Path.GetFullPath(partialUri));
System.Windows.Forms (15)
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (2)
156return new Uri(path); 162return new Uri(path);
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
154return string.IsNullOrEmpty(hrefString) ? null : new Uri(hrefString);
System\Windows\Forms\Controls\WebBrowser\HtmlElementErrorEventArgs.cs (1)
40public Uri Url => _url ??= new Uri(_urlString);
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (1)
237return string.IsNullOrEmpty(hrefString) ? null : new(hrefString);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (3)
237Uri url = new(hrefString); 289Url = new Uri("about:blank"); 579return new Uri(urlString);
System\Windows\Forms\Controls\WebBrowser\WebBrowser.WebBrowserEvent.cs (3)
64new Uri(urlString), targetFrameName is null ? string.Empty : (string)targetFrameName); 96new Uri(urlString)); 117new Uri(urlString));
System\Windows\Forms\Controls\WebBrowser\WebBrowserUriTypeConverter.cs (1)
19uri = new Uri($"http://{uri.OriginalString.AsSpan().Trim()}");
System\Windows\Forms\Help\Help.cs (3)
211file = new Uri($"{file}#{stringParam}"); 247file = new Uri(partialUri); 271file = new Uri(new Uri(AppContext.BaseDirectory),
System.Xaml (3)
System\Xaml\InfosetObjects\XamlObjectWriter.cs (2)
1654ctx.BaseUri = new Uri((string)value); 2097ctx.BaseUri = new Uri((string)value);
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
187_mergedSettings.BaseUri = new Uri(myXmlReader.BaseURI);
vstest.console (4)
Processors\Utilities\LoggerUtilities.cs (1)
39var loggerUri = new Uri(loggerIdentifier);
TestPlatformHelpers\TestRequestManager.cs (3)
1057Uri = new Uri(ConsoleLogger.ExtensionUri), 1083Uri = new Uri(ConsoleLogger.ExtensionUri) 1118Uri = new Uri(MSBuildLogger.ExtensionUri)
vstest.console.arm64 (4)
parent\vstest.console\Processors\Utilities\LoggerUtilities.cs (1)
39var loggerUri = new Uri(loggerIdentifier);
parent\vstest.console\TestPlatformHelpers\TestRequestManager.cs (3)
1057Uri = new Uri(ConsoleLogger.ExtensionUri), 1083Uri = new Uri(ConsoleLogger.ExtensionUri) 1118Uri = new Uri(MSBuildLogger.ExtensionUri)
WaitFor.Frontend (1)
Program.cs (1)
9builder.Services.AddHttpClient<ApiClient>(c => c.BaseAddress = new("http://api"));
WebFrontEnd (3)
Program.cs (3)
10builder.Services.AddHttpClient("gateway", client => client.BaseAddress = new Uri("https+http://gateway")); 12builder.Services.AddHttpClient("nuget", client => client.BaseAddress = new Uri("https://nuget")); 17client.BaseAddress = new Uri(builder.Configuration["EXTERNAL_SERVICE_URL"]
Yarp.Frontend (1)
Program.cs (1)
11client.BaseAddress = new Uri("https+http://gateway");