-
-
Notifications
You must be signed in to change notification settings - Fork 991
Copy to $(OutDir) does not copy to benchmarkdotnet output folder #946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is there any solution for this issue so far? |
In this case we can't just add Copy to SettingsWeWantToCopy because the Copy command contains parameters (i.e. SourceFiles, DestinationFolder, etc) which may refer to some properties in csproj, and we'll be forced to process them all. I suggest to copy the content of user's bin folder to benchmark's bin folder assuming that user puts in there only files that he or she needs. @adamsitnik What do you think? |
Instead of <ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\x64\$(Configuration)\NativeDll.dll">
<Link>NativeDll.dll</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>True</Visible>
</None>
</ItemGroup> You can also copy the entire directory, using this method: <ItemGroup>
<None Include="C:\Resources\**\*.*">
<Link>%(Directory)\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>True</Visible>
</None>
</ItemGroup> |
I just blogged about this topic: https://wojciechnagorski.com/2019/09/using-native-dll-and-resource-files-in-benchmarkdotnet-projects/ I think BenchmarkDotNet should display a warning when @adamsitnik What do you think? |
I wonder if we could come up with a more generic solution implemented on the BDN side that would be transparent to the end-user. For example: by extending the auto-generated @eerhardt would copying all the files help with dotnet/performance#894 ? Do you have any suggestions for a more generic solution? |
I agree with @wojtpl2 that using As for helping with dotnet/performance#894, the native assemblies in that scenario should be getting copied to the output folder by default, because they come through a NuGet package. With the 3.0 .NET SDK, all the assets from NuGet packages should be copied to the output directory by default. |
I've tried
but still can't get my config files copied to benchmarkdotnet generated guid folder. any ideas? |
@bonesoul try Actually my background is that I want to benchmark a .net library with uses a huge C++ project under the hood that is made accessible with a C++/CLI wrapper. Because I have several projects that use C++ and .Net and generated files I have written clean msbuild target files that do the copying job for me. Unfortunately this clean approach does not work for BenchmarkDotNet and I will spend some time today to "invent" the deployment logic to work. A bit unfortunate because it takes some time to understand the reason for the benchmarks failing and some time more to make it work. |
@bonesoul I finally succeeded with
Please note: This method requires that all your resources you want to carry along need to exist at |
I have the following Copy action defined in my .csproj
When I try to run BenchmarkDotNet it does not copy the files to the \bin\release<Guid>... folder but just the default output folder.
What is the correct configuration to make this work?
The text was updated successfully, but these errors were encountered: