Updated now that we are on C#11/.NET7.0
MODIFY
src/Chapter01/Listing01.01.HelloWorldInC#.ps1
src/Chapter01/Listing01.01.HelloWorldInC#.ps1
@@ -36,11 +36,7 @@ class HelloWorld
$codeListing > Program.cs
Get-Content Program.cs
-
- Write-Warning "Remove dotnet build step once we upgrade to version 10"
- # Build with version 10 because dotnet version 6 defaults to an ImplicitUsings element in the project file.
- dotnet build /property:LangVersion=10
- dotnet run --no-build
+ dotnet run
}
finally {
Set-PSDebug -Off

MODIFY
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.ps1
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.ps1
@@ -28,7 +28,8 @@ switch ($TestStage) {
Get-Item $projectDirectory -ErrorAction Ignore | Remove-Item -Recurse -Force
Set-PSDebug -Trace $TraceLevel
dotnet new console --output $projectDirectory
- Set-Content (Join-Path $projectDirectory 'Directory.Build.props') '<Project><PropertyGroup><Nullable>enable</Nullable></PropertyGroup></Project>'
+ # No longer needed in .net7.0./C#11
+ # Set-Content (Join-Path $projectDirectory 'Directory.Build.props') '<Project><PropertyGroup><Nullable>enable</Nullable></PropertyGroup></Project>'
$SutCSFile = split-path -leaf $MyInvocation.MyCommand.Definition
$SutCSFile = Join-Path $PSScriptRoot "$([IO.Path]::GetFileNameWithoutExtension($SutCSFile)).cs"

MODIFY
src/Shared/Tests/PowerShellTestUtilities.cs
src/Shared/Tests/PowerShellTestUtilities.cs
@@ -12,7 +12,6 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Shared.Tests
return RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
}
-
public static Lazy<string?> _PowerShellCommand = new Lazy<string?>(() =>
{
string? powershellCommand = null;

Updated now that we are on C#11/.NET7.0