-
-
Notifications
You must be signed in to change notification settings - Fork 990
Autogenerated project is not able to reference a self-contained executable #2076
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
Hi @ShinyCraig Self contained apps work well with InProcessToolchain (#1685). You can also try passing an MSBuild argument to BDN: BenchmarkSwitcher
.FromAssembly(typeof(Program).Assembly)
.Run(args,
DefaultConfig.Instance
.AddJob(Job.Default.WithArguments(new Argument[] { new MsBuildArgument("/p:SelfContained=true") }))); but I am not sure if it's going to work, as the default toolchain builds the app instead of publishing it. |
Hi @adamsitnik Thanks for the help! That got me closer to running things, but I'm running in circles now. If I use something very similar to what you've provided me, I still get an error.
So I try specifying a RuntimeIdentifier, by either doing
or
Either way it goes back to the original error...
Apologies if this is a stupid question, but am I simply missing the proper way to pass both arguments in? Thanks for any help you can provide, it's greatly appreciated. |
@ShinyCraig is there any chance you could provide small repro? |
Hi @adamsitnik Apologies for the delay, here's a repo that demonstrates the issue I've been having. https://github.com/ShinyCraig/benchmarkissuedemo program.cs in BenchmarkRunner is where you'll want to look, I tried to comment and provide as much context as I can, but let me know if you need any other information. |
Hi @adamsitnik , any updates? Thanks! |
This comment was marked as outdated.
This comment was marked as outdated.
Actually, it looks like this was fixed in 0.13.2. Can you try with a more recent version (latest is 0.13.7) @ShinyCraig? |
I'm trying to benchmark code in a self-contained project and am encountering an issue where the autogenerated project is not being generated as a self-contained project leading to this error when I try to run my benchmark.
All of the projects in my benchmarking solution have true in them, but the generated csproj does not. I'm unsure how to properly set up my projects such that the project generated by benchmarkdotnet is also SelfContained, or if there's another way to do this without making my original code not self-contained I am all ears.
The set up of my project is I have a exe project with some code I want to test. A benchmark project with some code that calls code from the exe project, and a "runner" project that calls
var result = BenchmarkRunner.Run<MyBenchmark>();
Thanks for any assistance!
The text was updated successfully, but these errors were encountered: