Change extension on test/generated folders to "*.g"
MODIFY
.gitignore
.gitignore
# Files specific to this project:
*.encrypt # Generated by one of the projects and left around on occasion.
-src/Chapter10/ProcessExitTestProgram/
-HelloWorld/
+**/*.gc/ # Folders generated buy tests will use the *.g extension so they aren't check in.
+src/Chapter01/HelloWorld/
# Don't ignore DLLs in the src/Shared/Lib folder (which are frequently ignored by default in the .gitignore_global file)
!src/Shared/Lib/*

MODIFY
src/Chapter10.Tests/Listing10.23.RegisteringAFinalizerWithProcessExit.Tests.cs
src/Chapter10.Tests/Listing10.23.RegisteringAFinalizerWithProcessExit.Tests.cs
@@ -19,6 +19,8 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter10.Listing10_23.Tests
static string Ps1Path { get; } =
Path.GetFullPath(Path.Join(Ps1DirectoryPath, "Listing10.23.RegisteringAFinalizerWithProcessExit.ps1"), Environment.CurrentDirectory);
+ private const string ProjectName = "ProcessExitTestProgram.g";
+
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
@@ -26,7 +28,7 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter10.Listing10_23.Tests
Assert.AreEqual<int>(0, RunPowerShellScript(testStage, out string psOutput),
$"Script failed with $testStage='{testStage}'. psOutput:\n{psOutput}");
string projectFilePath =
- Path.Join(Ps1DirectoryPath, "ProcessExitTestProgram", "ProcessExitTestProgram.csproj");
+ Path.Join(Ps1DirectoryPath, ProjectName, $"{ProjectName}.csproj");
Assert.IsTrue(File.Exists(projectFilePath),
$"The expected project file, '{projectFilePath}', was not created.");
}

MODIFY
src/Chapter10/Listing10.13.MakingTypesAvailableExternally.ps1
src/Chapter10/Listing10.13.MakingTypesAvailableExternally.ps1
@@ -13,8 +13,8 @@ if('traceLevel' -notin $PSBoundParameters.Keys) {
"@
}
-[string]$LibraryProjectName = 'GeoCoordinates'
-[string]$ConsoleProgramProjectName = 'GeoCoordinateProgram'
+[string]$LibraryProjectName = 'GeoCoordinates.g'
+[string]$ConsoleProgramProjectName = 'GeoCoordinateProgram.g'
[xml]$directoryBuildPropsXml = ([xml](Get-Content "$PSScriptRoot/../../Directory.Build.props"))
[string]$langVersion = $directoryBuildPropsXml.Project.PropertyGroup.LangVersion

MODIFY
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.ps1
src/Chapter10/Listing10.23.RegisteringAFinalizerWithProcessExit.ps1
@@ -17,7 +17,7 @@ if(($TraceLevel -eq $null) -and 'TraceLevel' -notin $PSBoundParameters.Keys) {
}
#$LibraryProjectName = 'ProcessExit'
-$ConsoleProgramProjectName = 'ProcessExitTestProgram'
+$ConsoleProgramProjectName = 'ProcessExitTestProgram.g'
[string]$projectDirectory = (Join-Path $PSScriptRoot $ConsoleProgramProjectName)

Change extension on test/generated folders to "*.g"