diff --git a/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs b/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
index b3adfc3e3c..061b64a9a8 100644
--- a/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
+++ b/src/BenchmarkDotNet/Toolchains/NativeAot/Generator.cs
@@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Text;
+using System.Xml;
using BenchmarkDotNet.ConsoleArguments;
using BenchmarkDotNet.Detectors;
using BenchmarkDotNet.Detectors.Cpu;
@@ -155,8 +156,20 @@ private string GenerateProjectForNuGetBuild(BuildPartition buildPartition, Artif
{string.Join(Environment.NewLine, GetRdXmlFiles(buildPartition.RepresentativeBenchmarkCase.Descriptor.Type, logger).Select(file => $""))}
+{GetCustomProperties(buildPartition, logger)}
";
+ private string GetCustomProperties(BuildPartition buildPartition, ILogger logger)
+ {
+ var projectFile = GetProjectFilePath(buildPartition.RepresentativeBenchmarkCase.Descriptor.Type, logger);
+ var xmlDoc = new XmlDocument();
+ xmlDoc.Load(projectFile.FullName);
+
+ (string customProperties, _) = GetSettingsThatNeedToBeCopied(xmlDoc, projectFile);
+ return customProperties;
+ }
+
+
private string GetILCompilerPackageReference()
=> string.IsNullOrEmpty(ilCompilerVersion) ? "" : $@"";