Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PesterTests and devcontainer to .NET 8 #2430

Merged
merged 6 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
10 changes: 0 additions & 10 deletions .devcontainer/Dockerfile

This file was deleted.

35 changes: 18 additions & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.5/containers/dotnet
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "Pester",
"build": {
"dockerfile": "Dockerfile",
"args": {
// Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0
// Append -bullseye or -focal to pin to an OS version. Using focal (Ubuntu) for pwsh support
"VARIANT": "6.0-focal"
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-jammy",
"remoteUser": "vscode",
"customizations": {
"codespaces": {
"openFiles": [
"CONTRIBUTING.md"
]
},
"vscode": {
"settings": {},
"extensions": [
"ms-vscode.powershell",
"ms-dotnettools.csharp",
"redhat.vscode-xml",
"ms-azure-devops.azure-pipelines",
"GitHub.vscode-github-actions"
]
}
},
// Set *default* container specific settings.json values on container create.
"settings": {},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.powershell",
"ms-dotnettools.csharp",
"redhat.vscode-xml"
],
// Use 'postCreateCommand' to run commands after the container is created.
// Restoring the c# projects
"postCreateCommand": "dotnet restore src/csharp"
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ for more information.

## Building Pester

Pester is written in Powershell and C#. The C# solution requires .Net
Pester is written in Powershell and C#. The C# solution requires .NET
Framework SDKs and Developer Packs in order to compile, see links below
how to install those prior to building.

Expand Down Expand Up @@ -53,9 +53,9 @@ Get-Help ./build.ps1 -Detailed

Pester has a C# Solution which requires .NET Framework SDKs and Developer Packs in order to compile. The targeted frameworks can be found in `src\csharp\Pester\Pester.csproj`.

### Install .NET Core 6.0 SDK
### Install .NET 8.0 SDK

[Download Link](https://dotnet.microsoft.com/download/dotnet-core/6.0)
[Download Link](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)

### .Net Framework 4.5 Developer Pack
Copy link
Collaborator Author

@fflaten fflaten Apr 3, 2024

Choose a reason for hiding this comment

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

Is the .NET Framework 4.5 Developer Pack necessary now that we use Microsoft.NETFramework.ReferenceAssemblies package? Haven't tested building on Windows in a while.

Copy link
Member

Choose a reason for hiding this comment

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

Probably not (I have all of them installed so I cannot easily check), but the whole point of that nuget is that you can build .NET Framework even on Linux where it cannot run (without mono).

Copy link
Member

Choose a reason for hiding this comment

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

Cannot make suggestion that deletes it, please delete it.


Expand Down
3 changes: 2 additions & 1 deletion src/csharp/Pester/Pester.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- this version is used specifically to support as old version of PS6 as we can.
ignoring vulnerability warning until we move to 6.1.6 or later
issue: https://github.com/pester/Pester/issues/2207 -->
<PackageReference Include="System.Management.Automation" Version="6.0.4" />
<PackageReference Include="System.Management.Automation" Version="6.0.4" NoWarn="NU1903" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net452'">
Expand Down
13 changes: 8 additions & 5 deletions src/csharp/PesterTests/PesterTests.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<!-- Workaround for NETSDK1206 warning about version-specific RIDs in
Microsoft.Management.Infrastructure dependency. Resolved in PowerShell 7.4 SDK -->
<UseRidGraph>true</UseRidGraph>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageReference Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading