BenchmarkDotNet
                                
                                
                                
                                    BenchmarkDotNet copied to clipboard
                            
                            
                            
                        BenchmarkDotNet.Autogenerated doesn't have build events from original project
Hi everyone!
I have a POC application that has to copy some files for benchmark measures. So, I would like to copy some assets to outdir using build events. But when I'm using benchmark, I receive an error where all files are missing. Of course, because those files weren't copied to the target (output dir). So for the moment my post build event is copying all files for a dir on my root folder C:\ but it's not the best solution.
Do you have any suggestion for that?
I looked on the BenchmarkDotNet.Autogenerated.csproj, and I'm not certain if we could add the original post build events on the benchmark project to solve this.
Here's some piece of my original cs project file.
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
    <Exec Command="XCOPY /YEIRD "$(ProjectDir)Ressources\" "$(OutDir)\AssetFiles"" />
</Target>
And here is the BenchmarkDotNet.Autogenerated.csproj
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <ImportDirectoryBuildProps>false</ImportDirectoryBuildProps>
    <ImportDirectoryBuildTargets>false</ImportDirectoryBuildTargets>
    <AssemblyTitle>79f859be-68d2-4927-a53a-ba12ea0b4908</AssemblyTitle>
    <TargetFramework>net6.0</TargetFramework>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <PlatformTarget>x64</PlatformTarget>
    <AssemblyName>79f859be-68d2-4927-a53a-ba12ea0b4908</AssemblyName>
    <OutputType>Exe</OutputType>
    <OutputPath>bin\Release</OutputPath>
    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
    <DebugType>pdbonly</DebugType>
    <DebugSymbols>true</DebugSymbols>
    <UseSharedCompilation>false</UseSharedCompilation>
    <CodeAnalysisRuleSet></CodeAnalysisRuleSet>
    <Deterministic>true</Deterministic>
    <!-- needed for custom build configurations (only "Release" builds are optimized by default) -->
    <Optimize Condition=" '$(Configuration)' != 'Debug' ">true</Optimize>
    
    <!-- we set LangVersion after  which might contain LangVersion copied from the benchmarks project -->
    <LangVersion Condition="'$(LangVersion)' == '' Or ($([System.Char]::IsDigit('$(LangVersion)', 0)) And '$(LangVersion)' < '7.3')">latest</LangVersion>
    <AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="79f859be-68d2-4927-a53a-ba12ea0b4908.notcs" Exclude="bin\**;obj\**;**\*.xproj;packages\**" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="C:\Users\Flavio\repos\FindFiles\FindFiles\FindFiles.csproj" />
  </ItemGroup>
  <PropertyGroup>
<ServerGarbageCollection>false</ServerGarbageCollection>
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
</PropertyGroup>
</Project>
                                    
                                    
                                    
                                
Upvote for this. Due to this error https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/5.0/referencing-executable-generates-error Recommended fix is not working for our solution due to missing properties in autogenerated .csproj
I am facing the same issues ( post build step not executed) . Any idea how to solve this ?
Another case that should be fixed by #1403.