diff --git a/docs/Reproducible-MSBuild/Techniques/NetCoreTargetingPackRoot.md b/docs/Reproducible-MSBuild/Techniques/NetCoreTargetingPackRoot.md
deleted file mode 100644
index 8160d8d..0000000
--- a/docs/Reproducible-MSBuild/Techniques/NetCoreTargetingPackRoot.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# NetCoreTargetingPackRoot
-
-Similar to [`TargetFrameworkRootPath`](./TargetFrameworkRootPath.md), the MSBuild property `NetCoreTargetingPackRoot`
-controls where dotnet sdk builds "sniff out" installed reference assemblies for dotnet runtimes. The target
-`ResolveTargetingPackAssets` will try seeing if there are any such reference assemblies installed into the
-`dotnet/packs/` folder. If not found, then MSBuild's built in targets will attempt to resolve the appropriate
-Microsoft.NETCore.App.Ref nuget package instead.
-
-This can be problematic for reproducibility, as upgrading your .NET SDK can result in a different set of packs available, and possible build failures if that nuget package isn't available on your nuget feed.
-
-- Recommendation: Always
-- Impact: Low
-
-
-## Usage
-
-In Directory.Build.props
-
-```xml
-
- [UNDEFINED]
-
-```
-
-## References
-
-None. It appears this property, the ResolveTargetingPackAssets target, and ResolveTargetingPackAssets task are not properly documented at this time.
diff --git a/docs/Reproducible-MSBuild/Techniques/toc.md b/docs/Reproducible-MSBuild/Techniques/toc.md
index 271b39c..a54bb72 100644
--- a/docs/Reproducible-MSBuild/Techniques/toc.md
+++ b/docs/Reproducible-MSBuild/Techniques/toc.md
@@ -4,6 +4,5 @@
- [DisableImplicitNuGetFallbackFolder](./DisableImplicitNuGetFallbackFolder.md)
- [DisableImplicitLibraryPacksFolder](./DisableImplicitLibraryPacksFolder.md)
- [DOTNET_MULTILEVEL_LOOKUP](./DOTNET_MULTILEVEL_LOOKUP.md)
-- [NetCoreTargetingPackRoot](./NetCoreTargetingPackRoot.md)
- [NUGET_XMLDOC_MODE](./NUGET_XMLDOC_MODE.md)
- [TargetFrameworkRootPath](./TargetFrameworkRootPath.md)
diff --git a/src/DotNet.ReproducibleBuilds.Isolated/Sdk/Sdk.props b/src/DotNet.ReproducibleBuilds.Isolated/Sdk/Sdk.props
index 5652709..68869f2 100644
--- a/src/DotNet.ReproducibleBuilds.Isolated/Sdk/Sdk.props
+++ b/src/DotNet.ReproducibleBuilds.Isolated/Sdk/Sdk.props
@@ -37,14 +37,6 @@
Text="Error, TargetFrameworkRootPath not initialized. If you're building for net462 or any other version of desktop NETFramework, please reference the 'Microsoft.NETFramework.ReferenceAssemblies' nuget package and run restore on the project to fix up your framework reference paths." />
-
-
- [UNDEFINED]
-
-
diff --git a/tests/DotNet.ReproducibleBuilds.Isolated.Tests/IsolatedProjectTests.cs b/tests/DotNet.ReproducibleBuilds.Isolated.Tests/IsolatedProjectTests.cs
new file mode 100644
index 0000000..7c9f9f1
--- /dev/null
+++ b/tests/DotNet.ReproducibleBuilds.Isolated.Tests/IsolatedProjectTests.cs
@@ -0,0 +1,25 @@
+using DotNet.ReproducibleBuilds.Tests.Shared;
+
+using FluentAssertions;
+
+using Microsoft.Build.Utilities.ProjectCreation;
+
+namespace DotNet.ReproducibleBuilds.Isolated.Tests;
+
+public class IsolatedProjectTests : TestBase
+{
+ [Fact]
+ public void ProjectCanRestore()
+ {
+ ProjectCreator.Templates
+ .ReproducibleBuildsIsolatedProject(GetRandomFile(".csproj"), configureProject: project =>
+ {
+ project.Property("TargetFramework", GetCurrentTargetFrameworkMoniker());
+ })
+ .TryRestore(out bool result, out BuildOutput output);
+
+ output.Errors.Should().HaveCount(0);
+ output.Warnings.Should().HaveCount(0);
+ result.Should().BeTrue();
+ }
+}
diff --git a/tests/DotNet.ReproducibleBuilds.Tests/ContinuousIntegrationTests.cs b/tests/DotNet.ReproducibleBuilds.Tests/ContinuousIntegrationTests.cs
index a503914..0af4213 100644
--- a/tests/DotNet.ReproducibleBuilds.Tests/ContinuousIntegrationTests.cs
+++ b/tests/DotNet.ReproducibleBuilds.Tests/ContinuousIntegrationTests.cs
@@ -18,7 +18,7 @@ public void RespectsSetValue(bool? value, string expected)
using EnvironmentVariableSuppressor hostSuppressor = new("TF_BUILD"); // Suppress our own CI provider variables (i.e. Azure DevOps)
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.PropertyGroup()
.Property(ContinuousIntegrationBuild, value?.ToLowerInvariant())
.Project
@@ -34,14 +34,14 @@ public void RespectsGlobalProperties(Dictionary envVars)
// If ContinuousIntegrationBuild is not set, it should be set from the CI provider property
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.ProjectWithGlobalProperties(envVars)
.GetPropertyValue(ContinuousIntegrationBuild)
.Should().Be(true.ToLowerInvariant());
// If ContinuousIntegrationBuild is set, it should take precedence over the CI provider variables
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.ProjectWithGlobalProperties(envVars.With(ContinuousIntegrationBuild, false.ToLowerInvariant()))
.GetPropertyValue(ContinuousIntegrationBuild)
.Should().Be(false.ToLowerInvariant(), "because explicitly setting `ContinuousIntegrationBuild` should always win.");
diff --git a/tests/DotNet.ReproducibleBuilds.Tests/MinimumVersionTests.cs b/tests/DotNet.ReproducibleBuilds.Tests/MinimumVersionTests.cs
index 8ff3799..2db2e8d 100644
--- a/tests/DotNet.ReproducibleBuilds.Tests/MinimumVersionTests.cs
+++ b/tests/DotNet.ReproducibleBuilds.Tests/MinimumVersionTests.cs
@@ -20,7 +20,7 @@ public void BelowMinimumVersionEmitsWarning(string msbuildVersion, bool success,
};
ProjectCreator project = ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"));
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"));
if (suppress)
{
diff --git a/tests/DotNet.ReproducibleBuilds.Tests/ProjectTemplates.cs b/tests/DotNet.ReproducibleBuilds.Tests/ProjectTemplates.cs
index a3695b7..6345fc9 100644
--- a/tests/DotNet.ReproducibleBuilds.Tests/ProjectTemplates.cs
+++ b/tests/DotNet.ReproducibleBuilds.Tests/ProjectTemplates.cs
@@ -9,7 +9,7 @@ internal static class ProjectTemplates
{
private static readonly string ThisAssemblyDirectory = Path.GetDirectoryName(typeof(ProjectTemplates).Assembly.Location)!;
- public static ProjectCreator ReproducibleBuildProject(this ProjectCreatorTemplates templates, FileInfo project)
+ public static ProjectCreator ReproducibleBuildsProject(this ProjectCreatorTemplates templates, FileInfo project)
{
DirectoryInfo directory = project.Directory ?? throw new ArgumentException("Project's path does not appear to have a parent.", nameof(project));
@@ -26,6 +26,6 @@ public static ProjectCreator ReproducibleBuildProject(this ProjectCreatorTemplat
ProjectCollection projectCollection = new(); // Create a new collection for each project to ensure environment variables aren't shared between tests
return templates
- .SdkCsproj(path: project.FullName, targetFramework: "net9.0", projectCollection: projectCollection);
+ .SdkCsproj(path: project.FullName, targetFramework: "net8.0", projectCollection: projectCollection);
}
}
diff --git a/tests/DotNet.ReproducibleBuilds.Tests/SourceLinkTests.cs b/tests/DotNet.ReproducibleBuilds.Tests/SourceLinkTests.cs
index 725aec5..c303dd3 100644
--- a/tests/DotNet.ReproducibleBuilds.Tests/SourceLinkTests.cs
+++ b/tests/DotNet.ReproducibleBuilds.Tests/SourceLinkTests.cs
@@ -14,7 +14,7 @@ public class SourceLinkTests : TestBase
public void PublishRepositoryUrlIsSet(bool? publishRepositoryUrl, bool expected)
{
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.PropertyGroup()
.Property("PublishRepositoryUrl", publishRepositoryUrl.ToLowerInvariant())
.Project
@@ -29,7 +29,7 @@ public void PublishRepositoryUrlIsSet(bool? publishRepositoryUrl, bool expected)
public void DebugTypeIsSet(string? debugType, string expected)
{
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.PropertyGroup()
.Property("DebugType", debugType)
.Project
@@ -44,7 +44,7 @@ public void DebugTypeIsSet(string? debugType, string expected)
public void EmbedUntrackedSourcesIsSet(bool? embedUntrackedSources, bool expected)
{
ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.PropertyGroup()
.Property("PublishRepositoryUrl", embedUntrackedSources.ToLowerInvariant())
.Project
@@ -60,7 +60,7 @@ public void RepositoryBranchIsSet(Dictionary env, string expect
using IDisposable ciSuppressors = env.Select(kvp => new EnvironmentVariableSuppressor(kvp.Key)).ToDisposable(); // Suppress the mock CI provider (just in case)
ProjectCreator project = ProjectCreator.Templates
- .ReproducibleBuildProject(GetRandomFile(".csproj"))
+ .ReproducibleBuildsProject(GetRandomFile(".csproj"))
.PropertyGroup()
.Properties(env);
diff --git a/tests/Shared/TestBase.cs b/tests/Shared/TestBase.cs
index 9da4a54..b4c579f 100644
--- a/tests/Shared/TestBase.cs
+++ b/tests/Shared/TestBase.cs
@@ -15,6 +15,21 @@ public void Dispose()
GC.SuppressFinalize(this);
}
+ protected string GetCurrentTargetFrameworkMoniker()
+ {
+#if NETFRAMEWORK
+ return "net472";
+#elif NET8_0
+ return "net8.0";
+#elif NET9_0
+ return "net9.0";
+#elif NET10_0
+ return "net10.0";
+#else
+ throw new NotSupportedException("Unsupported target framework.");
+#endif
+ }
+
protected virtual void Dispose(bool isDisposing)
{
TestRootPath.Refresh();