Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Jun 13, 2025

This PR enable assembly signing for Debug build also.

Background
When using BenchmarkDotNet.TestAdapter and project contains net462 target.
net462 benchmarks are not shown on TestExplorer with Debug configuration.
And following error log is recorded on VS output window's Tests pane.

System.IO.FileLoadException: A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)'

Currently BenchmarkDotNet sign assembly on Release build only.
This PR change this behavior to sign Debug build assembly also.

What's Tested

  • BenchmarkDotNet.Samples (net462) benchmarks are shown on TestExplorer
  • It can display benchmarks on TestExplorer when benchmark project don't use assembly-signing.

@AndreyAkinshin
Copy link
Member

The current behavior of non-signed Debug builds was introduced in commit 5876f57 on April 12, 2016, by @adamsitnik. I am open to reconsidering this, but I would like to understand the use case better. Why do you want to use the Debug build of BenchmarkDotNet through VS TestExplorer?

P.S. BenchmarkDotNet intentionally creates inconveniences to prevent users from running benchmarks with non-optimized assemblies. Therefore, the absence of discovered tests with the Debug version of BenchmarkDotNet seems to be the desired behavior. 🙂

Copy link
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general the problem you have described is specific to our own solution, as all our customers use the Release builds we ship to nuget.org. But I don't mind improving our dev loop experience of course. Thanks for providing the fix @filzrev!

@adamsitnik adamsitnik merged commit f8390f8 into dotnet:master Jun 17, 2025
8 checks passed
@AndreyAkinshin AndreyAkinshin added this to the v0.15.3 milestone Jun 17, 2025
filzrev added a commit to filzrev/BenchmarkDotNet that referenced this pull request Jun 21, 2025
This was referenced Sep 17, 2025
CurtHagenlocher pushed a commit to apache/arrow-dotnet that referenced this pull request Sep 22, 2025
Updated [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet)
from 0.15.2 to 0.15.3.

<details>
<summary>Release notes</summary>

_Sourced from [BenchmarkDotNet's
releases](https://github.com/dotnet/BenchmarkDotNet/releases)._

## 0.15.3

Full changelog: https://benchmarkdotnet.org/changelog/v0.15.3.html

## Highlights

Improvements:

- Naot instruction set support for .NET 10+, migrate to ISA groupings in
CPU summary
[#​2828](dotnet/BenchmarkDotNet#2828)
- Support benchmark filtering for TestAdapter
[#​2662](dotnet/BenchmarkDotNet#2662)
[#​2788](dotnet/BenchmarkDotNet#2788)
- Support non-primitive external types in `ArgumentsSource`
[#​2820](dotnet/BenchmarkDotNet#2820)
- Enable MSBuild parallel build via `--nodeReuse:false`
[#​2693](dotnet/BenchmarkDotNet#2693)
[#​2814](dotnet/BenchmarkDotNet#2814)
- Improve CPU detection
[#​2747](dotnet/BenchmarkDotNet#2747)
[#​2749](dotnet/BenchmarkDotNet#2749)
- Enable assembly signing for debug build
[#​2774](dotnet/BenchmarkDotNet#2774)

Deprecations:

- Deprecated `WithNuget`
[#​2812](dotnet/BenchmarkDotNet#2812)

Bug fixes:

- Fix `InvalidOperationException` in diagnosers
[#​2758](dotnet/BenchmarkDotNet#2758)
[#​2805](dotnet/BenchmarkDotNet#2805)
- Fix file detection in `NativeMemoryProfiler`
[#​2794](dotnet/BenchmarkDotNet#2794)
[#​2795](dotnet/BenchmarkDotNet#2795)
- Fix long file paths issue in `EtwProfiler`
[#​2807](dotnet/BenchmarkDotNet#2807)
[#​2808](dotnet/BenchmarkDotNet#2808)
- Fix log duplications in TestAdapter
[#​2790](dotnet/BenchmarkDotNet#2790)
- Fix x86 disassembler error for net462
[#​2792](dotnet/BenchmarkDotNet#2792)
- Fix `IsNetCore` and `IsNativeAOT` for single-file apps without AOT
[#​2799](dotnet/BenchmarkDotNet#2799)
- Fix density plot generation in `RPlotExporter` for latest version of R
[#​2809](dotnet/BenchmarkDotNet#2809)


Commits viewable in [compare
view](dotnet/BenchmarkDotNet@v0.15.2...v0.15.3).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=BenchmarkDotNet&package-manager=nuget&previous-version=0.15.2&new-version=0.15.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants