From 9448c0f2352e7891e1453a7095ccc53976cb8839 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Sun, 7 Sep 2025 23:51:27 +0000
Subject: [PATCH 1/2] Initial plan
From 4e4825f230ae8fd0e7e55ac626b8915be4cd6e8b Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 8 Sep 2025 00:09:46 +0000
Subject: [PATCH 2/2] Fix NuGet package version configuration
Co-authored-by: Arash-Sabet <26050123+Arash-Sabet@users.noreply.github.com>
---
azure-pipelines.yml | 4 +-
src/Abstracts/TestBedFactoryFixture.cs | 2 +-
...Xunit.Microsoft.DependencyInjection.csproj | 46 +++++++++++++------
src/package.nuspec | 17 -------
4 files changed, 34 insertions(+), 35 deletions(-)
delete mode 100644 src/package.nuspec
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index b840175..c94c314 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -43,14 +43,14 @@ steps:
arguments: '--configuration $(BuildConfiguration)'
# Pack (with symbols & SourceLink) happens before publish to ensure packages are available as build artifacts
-- script: echo Packing library with symbols and SourceLink metadata
+- script: echo Packing library with symbols and SourceLink metadata - Version $(Major).$(Minor).$(Revision)
displayName: 'Pre-Pack Info'
- task: DotNetCoreCLI@2
displayName: 'Packing (nupkg + snupkg)'
inputs:
command: 'pack'
packagesToPack: '**/Xunit.Microsoft.DependencyInjection.csproj'
- arguments: '--configuration $(BuildConfiguration) /p:ContinuousIntegrationBuild=true /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --output $(Build.ArtifactStagingDirectory)/packages'
+ arguments: '--configuration $(BuildConfiguration) /p:ContinuousIntegrationBuild=true /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageVersion=$(Major).$(Minor).$(Revision) --output $(Build.ArtifactStagingDirectory)/packages'
nobuild: true
- task: DotNetCoreCLI@2
displayName: 'Running tests in example folder'
diff --git a/src/Abstracts/TestBedFactoryFixture.cs b/src/Abstracts/TestBedFactoryFixture.cs
index fc22384..4c8e473 100644
--- a/src/Abstracts/TestBedFactoryFixture.cs
+++ b/src/Abstracts/TestBedFactoryFixture.cs
@@ -110,7 +110,7 @@ private object CreateInstance(Type testType, IServiceProvider serviceProvider, I
// Use the fixture's existing GetKeyedService method instead of reflection
try
{
- var getKeyedServiceMethod = GetType().BaseType?.GetMethod("GetKeyedService",[typeof(string), typeof(ITestOutputHelper)])?.MakeGenericMethod(parameter.ParameterType);
+ var getKeyedServiceMethod = GetType().BaseType?.GetMethod("GetKeyedService", [typeof(string), typeof(ITestOutputHelper)])?.MakeGenericMethod(parameter.ParameterType);
arg = getKeyedServiceMethod?.Invoke(this, [key, testOutputHelper]);
}
catch
diff --git a/src/Xunit.Microsoft.DependencyInjection.csproj b/src/Xunit.Microsoft.DependencyInjection.csproj
index fef840a..d1bbba7 100644
--- a/src/Xunit.Microsoft.DependencyInjection.csproj
+++ b/src/Xunit.Microsoft.DependencyInjection.csproj
@@ -4,21 +4,37 @@