Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@
"ragzrs",
"rainfly",
"redisearch",
"remotemcp",
"requesturl",
"resourcegroup",
"resourcegroups",
Expand All @@ -553,6 +554,7 @@
"skillset",
"skillsets",
"skiptoken",
"slnx",
"southafricanorth",
"southcentralus",
"southeastasia",
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ mcp.json configuration for local development:
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "C:/code/mcp/servers/Azure.Mcp.Server/bin/Debug/net9.0/azmcp.exe",
"command": "C:/code/mcp/servers/Azure.Mcp.Server/bin/Debug/net10.0/azmcp.exe",
"args": ["server", "start"]
}
}
Expand Down
257 changes: 128 additions & 129 deletions AzureMcp.sln

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ If you are contributing significant changes, or if the issue is already assigned
- [Adding a New Command](#adding-a-new-command)
- [Testing](#testing)
- [Unit Tests](#unit-tests)
- [Cancellation plumbing](#cancellation-plumbing)
- [End-to-end Tests](#end-to-end-tests)
- [Testing Local Build with VS Code](#testing-local-build-with-vs-code)
- [Build the Server](#build-the-server)
- [Run the Azure MCP server in HTTP mode](#run-the-azure-mcp-server-in-http-mode)
- [Configure mcp.json](#configure-mcpjson)
- [Server Modes](#server-modes)
- [Start from IDE](#start-from-ide)
Expand Down Expand Up @@ -152,7 +154,7 @@ If you are contributing significant changes, or if the issue is already assigned
```
- Use the following command to find out the correct tool name for your new tool
```
cd servers/Azure.Mcp.Server/src/bin/Debug/net9.0
cd servers/Azure.Mcp.Server/src/bin/Debug/net10.0
./azmcp[.exe] tools list --name --namespace <tool_area>
```
- Commit the change.
Expand Down Expand Up @@ -193,7 +195,7 @@ Requirements:

To ensure the product code and unit tests can be cancelled quickly, contributors are required to write async methods (any returning `Task`, `ValueTask`, generic variants of those, etc.) to accept and invoke async methods with a `System.Threading.CancellationToken` parameter. The latter is enforced with the [CA2016 analyzer](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2016).

Mocks created with `NSubstitute.Substitue.For<T>()` and have [methods set up](https://nsubstitute.github.io/help/set-return-value/#for-methods) should be passed `NSubstitute.Arg.Any<CancellationToken>()` for required `System.Threading.CancellationToken` parameters. The same should be used when [checking for received calls on a mocked object](https://nsubstitute.github.io/help/received-calls/index.html). If the product code is expected to do something interesting with a supplied `System.Threading.CancellationToken` parameter, such as linking with other `System.Threading.CancellationToken`s with [`System.Threading.CancellationTokenSource.CreateLinkedTokenSource`](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtokensource.createlinkedtokensource), then consider testing for that behavior.
Mocks created with `NSubstitute.Substitute.For<T>()` and have [methods set up](https://nsubstitute.github.io/help/set-return-value/#for-methods) should be passed `NSubstitute.Arg.Any<CancellationToken>()` for required `System.Threading.CancellationToken` parameters. The same should be used when [checking for received calls on a mocked object](https://nsubstitute.github.io/help/received-calls/index.html). If the product code is expected to do something interesting with a supplied `System.Threading.CancellationToken` parameter, such as linking with other `System.Threading.CancellationToken`s with [`System.Threading.CancellationTokenSource.CreateLinkedTokenSource`](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtokensource.createlinkedtokensource), then consider testing for that behavior.

Real product code under unit testing must be passed `Xunit.TestContext.Current.CancellationToken` when async methods are invoked. This is to ensure the tests can end to avoid possible issues with the parent process waiting indefinitely for the test runner executable to exit.

Expand Down Expand Up @@ -267,7 +269,7 @@ $env:AzureAd__ClientId = "<your-client-id>"
$env:AzureAd__Instance = "https://login.microsoftonline.com/"

# Run the executable
./servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp.exe server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity
./servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp.exe server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity
```

```bash
Expand All @@ -279,7 +281,7 @@ export AzureAd__ClientId="<your-client-id>"
export AzureAd__Instance="https://login.microsoftonline.com/"

# Run the executable
./servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity
./servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp server start --transport http --outgoing-auth-strategy UseHostingEnvironmentIdentity
```

> **Note:** The environment variables listed above are taken from the `debug-remotemcp` profile in `launchSettings.json`. Replace `<your-tenant-id>` and `<your-client-id>` with your actual Azure AD tenant ID and client ID. These variables configure Azure AD authentication and the server endpoint for HTTP mode operation.
Expand Down Expand Up @@ -309,7 +311,7 @@ Update your mcp.json to point to the locally built azmcp executable.
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start"]
}
}
Expand Down Expand Up @@ -345,7 +347,7 @@ Optional `--namespace` and `--mode` parameters can be used to configure differen
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start"]
}
}
Expand All @@ -359,7 +361,7 @@ Optional `--namespace` and `--mode` parameters can be used to configure differen
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--namespace", "storage", "--namespace", "keyvault"]
}
}
Expand All @@ -373,7 +375,7 @@ Optional `--namespace` and `--mode` parameters can be used to configure differen
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--mode", "namespace"]
}
}
Expand All @@ -387,7 +389,7 @@ Optional `--namespace` and `--mode` parameters can be used to configure differen
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--mode", "single"]
}
}
Expand All @@ -402,7 +404,7 @@ It honors both --read-only and --namespace switches.
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--mode", "consolidated"]
}
}
Expand All @@ -416,7 +418,7 @@ It honors both --read-only and --namespace switches.
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--namespace", "storage", "--namespace", "keyvault", "--mode", "namespace"]
}
}
Expand All @@ -430,7 +432,7 @@ It honors both --read-only and --namespace switches.
"servers": {
"azure-mcp-server": {
"type": "stdio",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net9.0/azmcp[.exe]",
"command": "<absolute-path-to>/mcp/servers/Azure.Mcp.Server/src/bin/Debug/net10.0/azmcp[.exe]",
"args": ["server", "start", "--tool", "azmcp_storage_account_get", "--tool", "azmcp_subscription_list"]
}
}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
34 changes: 16 additions & 18 deletions Directory.Packages.props
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the following also be updated:

System.Formats.Asn1 -> 10.0.0
Microsoft.Extensions.AI.Abstractions -> 10.0.0
Microsoft.Extensions.AI.Evaluation.Quality -> 10.0.0
Microsoft.AspNetCore.SignalR.Client -> 10.0.0
Microsoft.Extensions.Caching.Memory -> 10.0.0
Microsoft.Extensions.Configuration -> 10.0.0
Microsoft.Extensions.Configuration.EnvironmentVariables -> 10.0.0
Microsoft.Extensions.Configuration.Json -> 10.0.0
Microsoft.Extensions.DependencyInjection -> 10.0.0
Microsoft.Extensions.Hosting -> 10.0.0
System.CommandLine -> 2.0.0
System.Numerics.Tensors -> 10.0.0
System.Text.Json -> 10.0.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, but now we get some new AOT failures:
https://dev.azure.com/azure-sdk/public/public%20Team/_build/results?buildId=5603241&view=logs&j=1e679852-4871-5dae-dd38-eb073eb853d4&t=3639d9f6-46e5-5c59-1fa3-9c261e132d8a&l=105

ILLink : Trim analysis error IL2026: Azure.AI.OpenAI.Files.AzureFileExpirationOptions.PersistableModelWriteCore(ModelReaderWriterOptions): Using member 'System.ClientModel.Primitives.ModelReaderWriter.Write(!!0, ModelReaderWriterOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. This method uses reflection.  Use the overload that takes a ModelReaderWriterContext to be AOT compatible. [/mnt/vss/_work/1/s/servers/Azure.Mcp.Server/src/Azure.Mcp.Server.csproj]
ILLink : Trim analysis error IL2026: Azure.AI.OpenAI.CustomSerializationHelpers.SerializeInstance<TOutput,UInstanceInput>(UInstanceInput, ModelReaderWriterOptions): Using member 'System.ClientModel.Primitives.ModelReaderWriter.Write(Object, ModelReaderWriterOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. This method uses reflection.  Use the overload that takes a ModelReaderWriterContext to be AOT compatible. [/mnt/vss/_work/1/s/servers/Azure.Mcp.Server/src/Azure.Mcp.Server.csproj]
ILLink : Trim analysis error IL2026: Azure.ResourceManager.HDInsight.Models.HDInsightLocalizedName.System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.HDInsight.Models.HDInsightLocalizedName>.Write(ModelReaderWriterOptions): Using member 'System.ClientModel.Primitives.ModelReaderWriter.Write(!!0, ModelReaderWriterOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. This method uses reflection.  Use the overload that takes a ModelReaderWriterContext to be AOT compatible. [/mnt/vss/_work/1/s/servers/Azure.Mcp.Server/src/Azure.Mcp.Server.csproj]
ILLink : Trim analysis error IL2026: Azure.ResourceManager.HDInsight.Models.HDInsightUsage.System.ClientModel.Primitives.IPersistableModel<Azure.ResourceManager.HDInsight.Models.HDInsightUsage>.Write(ModelReaderWriterOptions): Using member 'System.ClientModel.Primitives.ModelReaderWriter.Write(!!0, ModelReaderWriterOptions)' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. This method uses reflection.  Use the overload that takes a ModelReaderWriterContext to be AOT compatible. [/mnt/vss/_work/1/s/servers/Azure.Mcp.Server/src/Azure.Mcp.Server.csproj]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hallipr, could you update Azure.ResourceManager.HDInsight to 1.2.0-beta.5? I'll look into Azure.AI.OpenAI

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking with the .NET SDK team on Microsoft.Extensions.AI.OpenAI. If this PR is urgent, we can keep the current version of Microsoft.Extensions.AI.OpenAI and just update Azure.ResourceManager.HDInsight to 1.2.0-beta.5.

Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,36 @@
<PackageVersion Include="Azure.ResourceManager.ResourceGraph" Version="1.1.0" />
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="13.0.2" />
<PackageVersion Include="Microsoft.Identity.Client.Broker" Version="4.72.1" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.10.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Evaluation" Version="9.10.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="9.10.0" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.10.0-preview.1.25513.3" />
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.0.1" />
<PackageVersion Include="Microsoft.Extensions.AI.Evaluation" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.AI.Evaluation.Quality" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="10.0.1-preview.1.25571.5" />
<PackageVersion Include="ModelContextProtocol" Version="0.4.0-preview.3" />
<PackageVersion Include="ModelContextProtocol.AspNetCore" Version="0.4.0-preview.3" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.0" />
<PackageVersion Include="Microsoft.Identity.Abstractions" Version="9.5.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="4.0.1" />
<PackageVersion Include="Microsoft.Identity.Web.Azure" Version="4.0.1" />
<PackageVersion Include="Microsoft.HybridRow" Version="1.1.0-preview3" />
<PackageVersion Include="Microsoft.Azure.Cosmos.Aot" Version="0.1.4-preview.2" />
<PackageVersion Include="Microsoft.Azure.Mcp.AzTypes.Internal.Compact" Version="0.2.802" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.0" />
<PackageVersion Include="MySqlConnector" Version="2.4.0" />
<PackageVersion Include="Npgsql" Version="9.0.3" />
<PackageVersion Include="Npgsql" Version="10.0.0" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
<PackageVersion Include="System.Formats.Asn1" Version="9.0.9" />
<PackageVersion Include="System.CommandLine" Version="2.0.0" />
<PackageVersion Include="System.Formats.Asn1" Version="10.0.0" />
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
<PackageVersion Include="System.Linq.AsyncEnumerable" Version="10.0.0-rc.1.25451.107" />
<PackageVersion Include="System.Net.ServerSentEvents" Version="10.0.0-rc.1.25451.107" />
<PackageVersion Include="System.Numerics.Tensors" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.9" />
<PackageVersion Include="System.Numerics.Tensors" Version="10.0.0" />
<PackageVersion Include="System.Text.Json" Version="10.0.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.12.0" />
<PackageVersion Include="Azure.Monitor.OpenTelemetry.AspNetCore" Version="1.3.0" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.11.0" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="9.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.0" />
<PackageVersion Include="Azure.Search.Documents" Version="11.7.0-beta.7" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
Expand Down
1 change: 0 additions & 1 deletion core/Azure.Mcp.Core/src/Azure.Mcp.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
<PackageReference Include="Microsoft.Identity.Web" />
<PackageReference Include="Microsoft.Identity.Web.Azure" />
<PackageReference Include="ModelContextProtocol.AspNetCore" />
<PackageReference Include="System.Linq.AsyncEnumerable" />
</ItemGroup>
</Project>
12 changes: 11 additions & 1 deletion core/Azure.Mcp.Core/tests/Azure.Mcp.Tests/Client/TestProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,15 @@ private static async Task _pumpAsync(StreamReader reader, StringBuilder sink, Ca
{
try
{
while (!ct.IsCancellationRequested && !reader.EndOfStream)
while (!ct.IsCancellationRequested)
{
var line = await reader.ReadLineAsync(ct).ConfigureAwait(false);

if (line == null)
{
break;
}

lock (sink)
{
sink.AppendLine(line);
Expand All @@ -279,22 +283,28 @@ private static async Task _pumpAsync(StreamReader reader, StringBuilder sink, Ca
private int? _waitForHttpPort(TimeSpan timeout)
{
var start = DateTime.UtcNow;

while ((DateTime.UtcNow - start) < timeout)
{
string text;
lock (stdout)
{
text = stdout.ToString();
}

foreach (var line in text.Split('\n'))
{
if (_tryParsePort(line.Trim(), out var p))
{
return p;
}
}

if (_process?.HasExited == true)
{
break;
}

Thread.Sleep(50);
}
return null;
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/templates/jobs/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ jobs:
inputs:
useGlobalJson: true

- task: UseDotNet@2
displayName: "Use .NET SDK 9.0.x"
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 9.0.x
Comment on lines -16 to -21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending how soon we want this PR in may still need this but be updated to 10.0.x as not all hosted images have updated to include .NET Core 10.0 yet

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a task just above these that installs the version in global.json

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were having to also install 9.0 after 10-preview because we wanted 10.0-preview tooling, but a 9.0 dependency


- task: Powershell@2
displayName: "Run source analysis"
inputs:
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/templates/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ jobs:
inputs:
useGlobalJson: true

- task: UseDotNet@2
displayName: "Use .NET SDK 9.0.x"
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 9.0.x

- task: Powershell@2
displayName: "Build code"
condition: and(succeeded(), ne(variables['NoPackagesChanged'],'true'))
Expand Down
7 changes: 0 additions & 7 deletions eng/pipelines/templates/jobs/live-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ jobs:
inputs:
useGlobalJson: true

- task: UseDotNet@2
displayName: "Use .NET SDK 9.0.x"
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 9.0.x

- task: NodeTool@0
displayName: "Install Node.js 22"
inputs:
Expand Down
15 changes: 9 additions & 6 deletions eng/scripts/Test-Code.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

[CmdletBinding()]
param(
[string] $TestResultsPath,
[Parameter(Position=0)]
[string[]] $Paths,
[string[]] $Members,
[ValidateSet('Live', 'Unit', 'All', 'Recorded')]
[string] $TestType = 'Unit',
[string] $TestResultsPath,
[switch] $CollectCoverage,
[switch] $OpenReport,
[switch] $TestNativeBuild,
Expand Down Expand Up @@ -88,16 +89,18 @@ function CreateTestSolution {
# Create solution and add projects
Write-Host "Creating temporary solution file..."

Push-Location $workPath
$originalLocation = Get-Location
Set-Location $workPath
try {
dotnet new sln -n "Tests" | Out-Null
dotnet new sln -n "Tests" --format slnx | Out-Null
dotnet sln add $testProjects --in-root | Out-Host

$fullPath = Resolve-Path 'Tests.slnx'
return $fullPath
}
finally {
Pop-Location
Set-Location $originalLocation
}

return "$workPath/Tests.sln"
}

function Create-CoverageReport {
Expand Down
Loading
Loading