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

Skip to content

Conversation

@nohwnd
Copy link
Member

@nohwnd nohwnd commented Oct 17, 2025

Description

Partially fix dotnet/sdk#50950 by disabling the DynamicNative instrumentation by default for all code coverage versions.

This change applies the workaround 1 to all runs under vstest 18: dotnet/sdk#50950 (comment)

 <CodeCoverage>
    <EnableDynamicNativeInstrumentation>false</EnableDynamicNativeInstrumentation>
</CodeCoverage>

This reduces the blast radius of the linked issue. DynamicNative code coverage is not needed for projects that only deal with .NET (managed) components.

If user explicitly enables DynamicNative they will still see the error until a fixed version of Code Coverage is published that loads covrun64 in a way that is compatible with .NET 10.

This change will be effective in VSTest 18, including VisualStudio 18, and dotnet test in .NET 10 SDK 10.0.1xx.

User can globally opt out from this fix by setting VSTEST_DISABLE_DYNAMICNATIVE_CODECOVERAGE_DEFAULT_SETTING=1. Or they can opt out per run by using runsettings and setting the value themselves to the desired value.

@jakubch1
Copy link
Member

LGTM but I would ASAP fix logic in code coverage repository for detection of .NET processes.

Simple scenario in VS 18.0 will still fail with those changes:

  1. Create new solution
  2. Add nunit project (.NET10)
  3. Add any C++ project (console app, ...) (can be completely independent from nunit project)
  4. Run nunit project tests

This will continue failing because.

  1. VS will detect C++ project and configure in runsettings EnableNativeDynamicInstrumentation = true
  2. The flag is passed to vstest.console.
  3. Vstest.console will not update it as it already exists
  4. We finish with covrun64 issue again

Copy link
Member

@Youssef1313 Youssef1313 left a comment

Choose a reason for hiding this comment

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

Approving with a nit question.

@nohwnd nohwnd merged commit b7e8733 into microsoft:rel/18.0 Oct 17, 2025
6 checks passed
@Youssef1313
Copy link
Member

@nohwnd Do we want to forward port to main?

@nohwnd nohwnd changed the title Disable DynamicNative instrumentation by default [rel/18.0] Disable DynamicNative instrumentation by default Oct 20, 2025
@nohwnd
Copy link
Member Author

nohwnd commented Oct 20, 2025

/backport to main

nohwnd added a commit to nohwnd/vstest that referenced this pull request Oct 20, 2025
* Disable DynamicNative instrumentation by default

* Also commit tests

* Apply suggestion from @nohwnd
nohwnd added a commit that referenced this pull request Oct 20, 2025
* Disable DynamicNative instrumentation by default

* Also commit tests

* Apply suggestion from @nohwnd
nohwnd added a commit that referenced this pull request Oct 20, 2025
* Disable DynamicNative instrumentation by default

* Also commit tests

* Apply suggestion from @nohwnd
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