diff --git a/src/Chapter23.Tests/Listing23.20.DesignatingABlockForUnsafeCode.Tests.cs b/src/Chapter23.Tests/Listing23.20.DesignatingABlockForUnsafeCode.Tests.cs index 6013145d7..af00bca96 100644 --- a/src/Chapter23.Tests/Listing23.20.DesignatingABlockForUnsafeCode.Tests.cs +++ b/src/Chapter23.Tests/Listing23.20.DesignatingABlockForUnsafeCode.Tests.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter23.Listing23_20.Tests; - +#if NET8_0_OR_GREATER [TestClass] public class Listing21_20_Tests { @@ -21,3 +21,4 @@ public void GetProcessorIdReturnsCorrectValue() }); } } +#endif \ No newline at end of file diff --git a/src/Chapter23/Listing23.20.DesignatingABlockForUnsafeCode.cs b/src/Chapter23/Listing23.20.DesignatingABlockForUnsafeCode.cs index 00ec68959..183254e9f 100644 --- a/src/Chapter23/Listing23.20.DesignatingABlockForUnsafeCode.cs +++ b/src/Chapter23/Listing23.20.DesignatingABlockForUnsafeCode.cs @@ -1,5 +1,6 @@ namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter23.Listing23_20; +#if NET8_0_OR_GREATER #region INCLUDE using System; using System.Runtime.InteropServices; @@ -268,3 +269,4 @@ public static IntPtr AllocExecutionBlock(int size) size, GetCurrentProcessHandle()); } } +#endif \ No newline at end of file