-
Notifications
You must be signed in to change notification settings - Fork 323
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
17.3.2 fails with MethodAccessException #4106
Comments
Does it repro also with |
I just tested using |
Same problem also occurs using 17.4.1
|
@cakirpro could you possibly send the whole content of your csproj file, please? |
Closing issue as there is no activity. |
Hi, PR: SonarSource/sonar-dotnet#7873 I can run UTs locally - those run without altcover. Also the
|
..it happened only on net7.0 TFM, it did not happen on net48 TFM. |
When running without altcover, it works. So altcover does something that is not liked by the SDK or MsTest :/ Edit: |
Microsoft.NET.Test.Sdk 17.7.2 still produces the error in logs, doesn't fail the UT run and doesn't produce coverage file as a side effect. |
The error is reproducible updating Microsoft.NET.Test.Sdk to version 17.8.0 (works with version 17.6.0) and it is only when AltCover is used. bash: if /p:AltCover=true is removed it don't throw error but of course then no cover report is produced. error: Microsoft.NET.Test.Sdk 17.8.0 |
Same error is reproducible with Thanks @hulken76 for pointing out that it works with SDK version 17.6.0. Can confirm that downgrading to this version fixed the issue for us as well. |
@SteveGilham could it be an instrumentation issue? @plillevold can you setup AltCover to filter out all libraries starting with |
This looks like AltCover issue 198.
The latest AltCover release (8.6.125) addresses this as best it can by adding new In general, coverage data gathered from the test runner (as from any other third-party libraries e.g. On a machine with access to the source (developer or build-with-validation machine), then the For the record, the base exclusion I use in the AltCover build and validate is AssemblyFilter =
[ @"\.DataCollector"
"Sample"
"Microsoft"
"testhost" ] where I exclude some of my own infrastructure, all my example code for analysis, anything Microsoft, and the test runner itself. Of course, if someone developing at Microsoft wants to use AltCover, I would not want to flatly exclude their use of the tool by hard-coding these exclusions. |
In fact, we were already excluding
@SteveGilham put me on the track of the culprit, though, as we were not excluding |
I'm going to close the issue so. |
Same like: #4106 (comment) Can confirm that downgrading to this version fixed the issue for us as well. |
- Updated to latest working one according to comment here: microsoft/vstest#4106 (comment)
Description
I have a unit test project referencing Microsoft.NET.Test.Sdk v 17.3.2:
When I run
dotnet test
on that project, an exception is output:Steps to reproduce
See above. Using .NET 6:
Expected behavior
Version 17.2.0 does NOT encounter this error for the exact same project.
Actual behavior
Error output as shown above.
Diagnostic logs
Environment
WSL 2 using Ubuntu: lsb_release -a output:
The text was updated successfully, but these errors were encountered: