Skip to content
Open
Changes from all 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
16 changes: 16 additions & 0 deletions src/BenchmarkDotNet/Toolchains/CsProj/CsProjGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ protected override void GenerateProject(BuildPartition buildPartition, Artifacts
.ToString();

File.WriteAllText(artifactsPaths.ProjectFilePath, content);

// We create an empty Directory.Build.props file next to the project file to ignore other prop files
// https://github.com/dotnet/BenchmarkDotNet/issues/2371#issuecomment-1814709479
string propsFilePath = Path.Combine(Path.GetDirectoryName(artifactsPaths.ProjectFilePath), "Directory.Build.props");
if (!File.Exists(propsFilePath))
{
File.WriteAllText(propsFilePath, @"
<Project>
<!-- This is an empty Directory.Build.props file to prevent projects which reside
under this directory to use any of the repository local settings. -->
<PropertyGroup>
<ImportDirectoryPackagesProps>false</ImportDirectoryPackagesProps>
<ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
</PropertyGroup>
</Project>");
}
}

/// <summary>
Expand Down