Skip to content
Merged
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
16 changes: 11 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
ContinuousIntegrationBuild: 'true'
DotNet8Version: '8.x'
DotNet10Version: '10.x'
DotNet11Version: '11.x'

jobs:
BuildAndTest:
Expand All @@ -44,28 +45,33 @@ jobs:
with:
fetch-depth: 0

- name: Install .NET ${{ env.DotNet8Version }} and ${{ env.DotNet10Version }}
uses: actions/setup-dotnet@v5
- name: Install .NET ${{ env.DotNet8Version }}, ${{ env.DotNet10Version }} and ${{ env.DotNet11Version }}
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
${{ env.DotNet8Version }}
${{ env.DotNet10Version }}
${{ env.DotNet11Version }}

- name: Build Solution
id: build
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/build.binlog"

- name: Run Unit Tests (.NET Framework)
if: ${{ startsWith(matrix.name, 'Windows') && !cancelled() && steps.build.outcome == 'success' }}
run: dotnet test --no-restore --no-build --framework net472 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net472.binlog"
run: dotnet test --no-restore --no-build --framework net472 --configuration ${{ env.BuildConfiguration }} --show-stdout Failed --show-stderr Failed

- name: Run Unit Tests (.NET 8)
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: dotnet test --no-restore --no-build --framework net8.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net8.0.binlog"
run: dotnet test --no-restore --no-build --framework net8.0 --configuration ${{ env.BuildConfiguration }} --show-stdout Failed --show-stderr Failed

- name: Run Unit Tests (.NET 10)
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: dotnet test --no-restore --no-build --framework net10.0 "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}/test-net10.0.binlog"
run: dotnet test --no-restore --no-build --framework net10.0 --configuration ${{ env.BuildConfiguration }} --show-stdout Failed --show-stderr Failed

- name: Run Unit Tests (.NET 11)
if: ${{ !cancelled() && steps.build.outcome == 'success' }}
run: dotnet test --no-restore --no-build --framework net11.0 --configuration ${{ env.BuildConfiguration }} --show-stdout Failed --show-stderr Failed

- name: Upload Artifacts
uses: actions/upload-artifact@v7
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
BuildPlatform: 'Any CPU'
ContinuousIntegrationBuild: 'true'
OfficialBuild: 'true'
DotNet10Version: '10.x'
DotNet11Version: '11.x'

jobs:
build:
Expand All @@ -28,11 +28,11 @@ jobs:
with:
fetch-depth: 0

- name: Install .NET ${{ env.DotNet10Version }}
uses: actions/setup-dotnet@v5
- name: Install .NET ${{ env.DotNet11Version }}
uses: actions/setup-dotnet@v6
with:
dotnet-version: |
${{ env.DotNet10Version }}
${{ env.DotNet11Version }}

- name: Build Solution
run: dotnet build "/Property:Platform=${{ env.BuildPlatform }};Configuration=${{ env.BuildConfiguration }}" "/BinaryLogger:${{ env.ArtifactsDirectoryName }}\build.binlog"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ PublishScripts/
*.nuget.g.props
*.nuget.g.targets
project.assets.json
.nuget/

# Microsoft Azure Build Output
csx/
Expand Down
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<Nullable>enable</Nullable>
<RestoreUseStaticGraphEvaluation>true</RestoreUseStaticGraphEvaluation>
<SignAssembly>true</SignAssembly>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<VsTestUseMSBuildOutput>true</VsTestUseMSBuildOutput>
<_MSBUILDTLENABLED>1</_MSBUILDTLENABLED>
</PropertyGroup>
Expand Down
22 changes: 12 additions & 10 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<MicrosoftBuildPackageVersion>18.6.3</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion>18.10.1</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net10.0'">18.9.6</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion Condition="'$(TargetFramework)' == 'net8.0'">17.11.48</MicrosoftBuildPackageVersion>
<MicrosoftCodeAnalysisCSharpVersion>5.3.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpVersion>5.9.0</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpVersion Condition="'$(TargetFramework)' == 'net8.0'">4.13.0</MicrosoftCodeAnalysisCSharpVersion>
<SystemCodeDomVersion>10.0.8</SystemCodeDomVersion>
<SystemCodeDomVersion>10.0.12</SystemCodeDomVersion>
<SystemCodeDomVersion Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</SystemCodeDomVersion>
</PropertyGroup>
<ItemGroup>
Expand All @@ -15,22 +16,23 @@
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="4.14.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0" />
<PackageVersion Include="Microsoft.IO.Redist" Version="6.1.3" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
<PackageVersion Include="Microsoft.Testing.Platform.MSBuild" Version="2.4.1" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.14.2075" />
<PackageVersion Include="Microsoft.VisualStudio.SolutionPersistence" Version="1.0.52" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.204" />
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.246" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="System.IO.Compression" Version="4.3.0" />
<PackageVersion Include="System.CodeDom" Version="$(SystemCodeDomVersion)" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="xunit.v3" Version="4.0.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="Microsoft.Build.Artifacts" Version="6.1.63" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.300" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.9.50" />
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="10.0.401" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.10.94" />
<GlobalPackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<Compile Include="..\Shared\GlobalSuppressions.cs" />
<AdditionalFiles Include="..\Shared\stylecop.json" />
Expand Down
8 changes: 6 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestMinor"
"version": "11.0.100-rc",
"rollForward": "latestMinor",
"allowPrerelease": true
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net8.0;net10.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0;net10.0;net11.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -10,10 +10,11 @@
<PackageReference Include="Microsoft.Build" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.NET.Test.Sdk" ShadeDependencies="NuGet.Frameworks" />
<!--<PackageReference Include="Microsoft.NET.Test.Sdk" ShadeDependencies="NuGet.Frameworks" />-->
<PackageReference Include="Microsoft.Testing.Platform.MSBuild" />
<PackageReference Include="MSBuild.StructuredLogger" />
<PackageReference Include="Shouldly" />
<PackageReference Include="System.CodeDom" Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net10.0'" ExcludeAssets="Runtime" />
<PackageReference Include="System.CodeDom" Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net10.0' Or '$(TargetFramework)' == 'net11.0'" ExcludeAssets="Runtime" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>
Expand All @@ -24,9 +25,9 @@
<ProjectReference Include="..\Microsoft.Build.Utilities.ProjectCreation\Microsoft.Build.Utilities.ProjectCreation.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="System.Text.Json" VersionOverride="10.0.3" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.3" />
<PackageReference Include="System.Text.Json" VersionOverride="10.0.12" />
<PackageReference Include="System.Text.Encodings.Web" VersionOverride="10.0.12" />

<SuggestedBindingRedirects Include="System.Text.Encodings.Web, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" MaxVersion="10.0.0.3" />
<SuggestedBindingRedirects Include="System.Text.Encodings.Web, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" MaxVersion="10.0.0.12" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public string TargetFramework
"net8.0";
#elif NET10_0
"net10.0";
#elif NET11_0
"net11.0";
#elif NETFRAMEWORK
"net472";
#else
Expand Down Expand Up @@ -70,15 +72,27 @@ private void WriteGlobalJson()
$@"{{
""sdk"": {{
""version"": ""{GetDotNetSdkVersionString()}"",
""rollForward"": ""latestMinor""
""rollForward"": ""latestMinor"",
""allowPrelease"": ""{GetAllowPrereleaseString()}"",
}}
}}");
string GetAllowPrereleaseString()
{
#if NET11_0
return "true";
#else
return "false";
#endif
}

string GetDotNetSdkVersionString()
{
#if NET8_0
return "8.0.100";
#elif NET10_0
return "10.0.100";
#elif NET11_0
return "10.0.100-rc";
#elif NETFRAMEWORK
System.Diagnostics.FileVersionInfo fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(MSBuildAssemblyResolver.MSBuildExePath);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Microsoft.Build.Utilities.ProjectCreation
/// Provides a base class for unit test classes that use MSBuild. This class resolves MSBuild related assemblies automatically.
/// </summary>
/// <remarks>
/// Prefer calling <see cref="MSBuildAssemblyResolver.Register"/> from a <see cref="System.Runtime.CompilerServices.ModuleInitializerAttribute"/> if your target framework
/// Prefer calling <see cref="MSBuildAssemblyResolver.Register"/> from a <c>System.Runtime.CompilerServices</c> if your target framework
/// supports one. This base class is provided for backwards compatibility with older versions of .NET.
/// </remarks>
public abstract class MSBuildTestBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net472;net8.0;net10.0</TargetFrameworks>
<TargetFrameworks>net472;net8.0;net10.0;net11.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ArtifactsPath>..\..\artifacts\$(MSBuildProjectName)</ArtifactsPath>
Expand Down
Loading
Loading